账号:创建账号前的检查
This commit is contained in:
@@ -299,6 +299,10 @@ export default class Auth extends Service {
|
||||
console.log('enter Auth createRole');
|
||||
const ctx = this.ctx;
|
||||
const { uid } = ctx;
|
||||
const exist = await RoleModel.exists({ 'userInfo.uid': uid, serverId });
|
||||
if (exist === true) {
|
||||
return ctx.service.utils.resResult(STATUS.ROLE_EXIST);
|
||||
}
|
||||
const roleId = ctx.service.utils.genCode(10);
|
||||
const code = ctx.service.utils.genCode(6);
|
||||
const seqId = await Counter.getNewCounter(COUNTER.ROLE) || -1;
|
||||
|
||||
Reference in New Issue
Block a user