军团:屏蔽词
This commit is contained in:
@@ -26,10 +26,10 @@ Filter.prototype.before = async function (routeRecord: RouteRecord, msg: any, se
|
||||
let maintenServers = await pinus.app.rpc.connector.connectorRemote.getServerMainten.toServer(id);
|
||||
if(maintenServers.indexOf(serverId) != -1) { // 该服务器维护
|
||||
let isWhiteList = await checkWhiteListWithUid(uid);
|
||||
if(isWhiteList) next(null);
|
||||
if(isWhiteList) return next(null);
|
||||
|
||||
pinus.app.get('channelService').pushMessageByUids('onServerMaintenance', resResult(STATUS.SERVER_MAINTENANCE), [{ uid: roleId, sid }]);
|
||||
next(new Error(), resResult(STATUS.SERVER_MAINTENANCE));
|
||||
return next(new Error(), resResult(STATUS.SERVER_MAINTENANCE));
|
||||
}
|
||||
|
||||
let hasBlockWords = false;
|
||||
@@ -40,7 +40,7 @@ Filter.prototype.before = async function (routeRecord: RouteRecord, msg: any, se
|
||||
} else if (routeRecord.route == 'role.roleHandler.rename') {
|
||||
hasBlockWords = await checkFilterWords(msg.roleName);
|
||||
}
|
||||
if(hasBlockWords) next(new Error(), resResult(STATUS.BLOCK_WORDS));
|
||||
if(hasBlockWords) return next(new Error(), resResult(STATUS.BLOCK_WORDS));
|
||||
|
||||
next(null);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user