完善日志

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: '基础的权限管理功能,包括登录,权限校验', describe: '基础的权限管理功能,包括登录,权限校验',
// 中间件 // 中间件
middlewares: ['baseLogMiddleware', 'baseAuthorityMiddleware'], middlewares: ['baseAuthorityMiddleware', 'baseLogMiddleware'],
} as ModuleConfig; } as ModuleConfig;
}; };

View File

@ -23,7 +23,7 @@ export class BaseDepartmentController extends BaseController {
@Post('/order') @Post('/order')
async order(@Body(ALL) params: Object) { async order(@Body(ALL) params: Object) {
await this.baseDepartmentService.order(params); await this.baseDepartmentService.order(params);
this.ok(); return this.ok();
} }
} }

View File

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

View File

@ -21,7 +21,7 @@ export class BaseSysDepartmentService extends BaseService {
baseSysRoleDepartmentEntity: Repository<BaseSysRoleDepartmentEntity>; baseSysRoleDepartmentEntity: Repository<BaseSysRoleDepartmentEntity>;
@Inject() @Inject()
baseSysPremsService: BaseSysPermsService; baseSysPermsService: BaseSysPermsService;
@Inject() @Inject()
ctx: Context; ctx: Context;
@ -30,7 +30,7 @@ export class BaseSysDepartmentService extends BaseService {
* *
*/ */
async list () { 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(` const departments = await this.nativeQuery(`
SELECT SELECT
* *
@ -38,7 +38,7 @@ export class BaseSysDepartmentService extends BaseService {
base_sys_department a base_sys_department a
WHERE WHERE
1 = 1 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 ORDER BY
a.orderNum ASC`); a.orderNum ASC`);
if (!_.isEmpty(departments)) { if (!_.isEmpty(departments)) {