关闭sdk屏蔽

This commit is contained in:
luying
2022-07-02 13:51:30 +08:00
parent 59954961ee
commit ddc980456b
3 changed files with 10 additions and 3 deletions

View File

@@ -10,6 +10,7 @@ import { errlogger } from "../../../util/logger";
import { gameData } from "../../../pubUtils/data";
import { sendMessageToUser } from "../../../services/pushService";
import { isCheckWord } from "../../../pubUtils/sdkUtil";
import { isDevelopEnv } from "../../../services/utilService";
export function globalFilter(app: Application) {
return new Filter(app);
}
@@ -105,7 +106,7 @@ Filter.prototype.before = async function (routeRecord: RouteRecord, msg: any, se
}
let hasBlockWords = false;
if(isCheckWord()) {
if(isCheckWord(isDevelopEnv())) {
switch(routeRecord.route) {
case 'chat.chatHandler.sendPrivateMessage':
{

View File

@@ -0,0 +1,6 @@
import { pinus } from "pinus";
export function isDevelopEnv() {
const envs = ['development', 'monitor']
return envs.indexOf(pinus.app.get('env')) != -1;
}

View File

@@ -155,6 +155,6 @@ export function isDebugPay() {
return gameData.serverConst.DEBUG_PAY === 1;
}
export function isCheckWord() {
return gameData.serverConst.CHECK_WORD === 1;
export function isCheckWord(isDevelop = false) {
return gameData.serverConst.CHECK_WORD === 1 && !isDevelop;
}