mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2026-01-07 11:58:13 +00:00
完善日志
This commit is contained in:
parent
046940e2e8
commit
a5fc2bf0c2
@ -11,6 +11,6 @@ export default (app: Application) => {
|
|||||||
// 模块描述
|
// 模块描述
|
||||||
describe: '基础的权限管理功能,包括登录,权限校验',
|
describe: '基础的权限管理功能,包括登录,权限校验',
|
||||||
// 中间件
|
// 中间件
|
||||||
middlewares: ['baseLogMiddleware', 'baseAuthorityMiddleware'],
|
middlewares: ['baseAuthorityMiddleware', 'baseLogMiddleware'],
|
||||||
} as ModuleConfig;
|
} as ModuleConfig;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -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)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user