后台:修改权限用表

This commit is contained in:
luying
2022-01-04 11:19:08 +08:00
parent 70068402a1
commit c32744f276
13 changed files with 67 additions and 133 deletions

View File

@@ -1,5 +1,4 @@
import { GMUserModel } from '@db/GMUser';
import { GMUserGroupModel } from '@db/GMUserGroup'
import { GMGroupModel } from '@db/GMGroup'
import { GMRecordModel } from '@db/GMRecord'
import { GM_API_TYPE, STATUS } from '@consts';
@@ -25,14 +24,9 @@ module.exports = () => {
ctx.body = ctx.service.utils.resResult(STATUS.GM_MISS_API);
return;
}
let userGroup = await GMUserGroupModel.getUserGroupByUid(user.uid);
if(!userGroup) {
ctx.body = ctx.service.utils.resResult(STATUS.GM_NO_AUTHORITY_GET);
return
}
let group = await GMGroupModel.getGroupById(userGroup.groupId);
let group = await GMGroupModel.getGroupById(user.groupId);
if(!group) {
if(!group || !user.isEnable) {
ctx.body = ctx.service.utils.resResult(STATUS.GM_NO_AUTHORITY_GET);
return
}