mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2025-12-27 12:00:17 +00:00
完善日志
This commit is contained in:
parent
046940e2e8
commit
a5fc2bf0c2
@ -11,6 +11,6 @@ export default (app: Application) => {
|
||||
// 模块描述
|
||||
describe: '基础的权限管理功能,包括登录,权限校验',
|
||||
// 中间件
|
||||
middlewares: ['baseLogMiddleware', 'baseAuthorityMiddleware'],
|
||||
middlewares: ['baseAuthorityMiddleware', 'baseLogMiddleware'],
|
||||
} as ModuleConfig;
|
||||
};
|
||||
|
||||
@ -23,7 +23,7 @@ export class BaseDepartmentController extends BaseController {
|
||||
@Post('/order')
|
||||
async order(@Body(ALL) params: Object) {
|
||||
await this.baseDepartmentService.order(params);
|
||||
this.ok();
|
||||
return this.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@ -32,7 +32,7 @@ export class BaseSysLogController extends BaseController {
|
||||
@Post('/clear')
|
||||
public async clear() {
|
||||
await this.adminSysLogService.clear(true);
|
||||
this.ok();
|
||||
return this.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@ -21,7 +21,7 @@ export class BaseSysDepartmentService extends BaseService {
|
||||
baseSysRoleDepartmentEntity: Repository<BaseSysRoleDepartmentEntity>;
|
||||
|
||||
@Inject()
|
||||
baseSysPremsService: BaseSysPermsService;
|
||||
baseSysPermsService: BaseSysPermsService;
|
||||
|
||||
@Inject()
|
||||
ctx: Context;
|
||||
@ -30,7 +30,7 @@ export class BaseSysDepartmentService extends BaseService {
|
||||
* 获得部门菜单
|
||||
*/
|
||||
async list () {
|
||||
const permsDepartmentArr = await this.baseSysPremsService.departmentIds(this.ctx.admin.userId); // 部门权限
|
||||
const permsDepartmentArr = await this.baseSysPermsService.departmentIds(this.ctx.admin.userId); // 部门权限
|
||||
const departments = await this.nativeQuery(`
|
||||
SELECT
|
||||
*
|
||||
@ -38,7 +38,7 @@ export class BaseSysDepartmentService extends BaseService {
|
||||
base_sys_department a
|
||||
WHERE
|
||||
1 = 1
|
||||
${ this.setSql(this.ctx.decoded.userId !== '1', 'and a.id in (?)', [ !_.isEmpty(permsDepartmentArr) ? permsDepartmentArr : [ null ] ]) }
|
||||
${ this.setSql(this.ctx.admin.userId !== '1', 'and a.id in (?)', [ !_.isEmpty(permsDepartmentArr) ? permsDepartmentArr : [ null ] ]) }
|
||||
ORDER BY
|
||||
a.orderNum ASC`);
|
||||
if (!_.isEmpty(departments)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user