军团活动:修改debug接口

This commit is contained in:
luying
2021-10-13 17:58:51 +08:00
parent c2585609c6
commit e088c86a67
7 changed files with 44 additions and 21 deletions
@@ -31,12 +31,14 @@ Filter.prototype.before = async function (routeRecord: RouteRecord, msg: any, se
}
let hasBlockWords = false;
if(routeRecord.route == 'guild.guildHandler.createGuild') {
hasBlockWords = await checkFilterWords(msg.name);
} else if (routeRecord.route == 'role.roleHandler.initRole') {
hasBlockWords = await checkFilterWords(msg.roleName);
} else if (routeRecord.route == 'role.roleHandler.rename') {
hasBlockWords = await checkFilterWords(msg.roleName);
if(pinus.app.get('env') == 'production') {
if(routeRecord.route == 'guild.guildHandler.createGuild') {
hasBlockWords = await checkFilterWords(msg.name);
} else if (routeRecord.route == 'role.roleHandler.initRole') {
hasBlockWords = await checkFilterWords(msg.roleName);
} else if (routeRecord.route == 'role.roleHandler.rename') {
hasBlockWords = await checkFilterWords(msg.roleName);
}
}
if(hasBlockWords) return next(new Error(), resResult(STATUS.BLOCK_WORDS));