防护:添加人数过多防护措施
This commit is contained in:
@@ -289,6 +289,10 @@ export default class Auth extends Service {
|
||||
public async checkRole(serverId: number) {
|
||||
const ctx = this.ctx;
|
||||
const { uid } = ctx;
|
||||
|
||||
let canLogin = await this.ctx.service.utils.validateCanLogin();
|
||||
if(!canLogin) return this.ctx.service.utils.resResult(STATUS.ONLINE_USER_MAX);
|
||||
|
||||
const role = await RoleModel.findByUid(uid, serverId);
|
||||
if (role) {
|
||||
if(role.blockType == BLOCK_TYPE.BLOCK) {
|
||||
|
||||
Reference in New Issue
Block a user