完善日志

This commit is contained in:
ap 2021-02-25 00:24:56 +08:00
parent 046940e2e8
commit a5fc2bf0c2
4 changed files with 6 additions and 6 deletions

View File

@ -11,6 +11,6 @@ export default (app: Application) => {
// 模块描述
describe: '基础的权限管理功能,包括登录,权限校验',
// 中间件
middlewares: ['baseLogMiddleware', 'baseAuthorityMiddleware'],
middlewares: ['baseAuthorityMiddleware', 'baseLogMiddleware'],
} as ModuleConfig;
};

View File

@ -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();
}
}

View File

@ -32,7 +32,7 @@ export class BaseSysLogController extends BaseController {
@Post('/clear')
public async clear() {
await this.adminSysLogService.clear(true);
this.ok();
return this.ok();
}
}

View File

@ -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)) {