加密:增加可以选择不加密
This commit is contained in:
@@ -10,7 +10,7 @@ import { getServerMainten } from "../../../services/gmService";
|
|||||||
import { errlogger, infologger } from "../../../util/logger";
|
import { errlogger, infologger } from "../../../util/logger";
|
||||||
import { gameData } from "../../../pubUtils/data";
|
import { gameData } from "../../../pubUtils/data";
|
||||||
import { sendMessageToUser } from "../../../services/pushService";
|
import { sendMessageToUser } from "../../../services/pushService";
|
||||||
import { isCheckWord } from "../../../pubUtils/sdkUtil";
|
import { isCheckWord, isSkipEncode } from "../../../pubUtils/sdkUtil";
|
||||||
import { isDevelopEnv } from "../../../services/utilService";
|
import { isDevelopEnv } from "../../../services/utilService";
|
||||||
import { isNumber } from "underscore";
|
import { isNumber } from "underscore";
|
||||||
import { redisClient } from "../../../services/redisService";
|
import { redisClient } from "../../../services/redisService";
|
||||||
@@ -53,7 +53,7 @@ class Filter {
|
|||||||
if(!this.checkFunction(routeRecord.route)) {
|
if(!this.checkFunction(routeRecord.route)) {
|
||||||
return next(new Error('globalFilter'), resResult(STATUS.FUNCTION_CLOSE, { route: routeRecord.route }));
|
return next(new Error('globalFilter'), resResult(STATUS.FUNCTION_CLOSE, { route: routeRecord.route }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!checkRouteParam(routeRecord.route, msg)) {
|
if(!checkRouteParam(routeRecord.route, msg)) {
|
||||||
return next(new Error('globalFilter'), resResult(STATUS.WRONG_PARMS, { route: routeRecord.route }));
|
return next(new Error('globalFilter'), resResult(STATUS.WRONG_PARMS, { route: routeRecord.route }));
|
||||||
}
|
}
|
||||||
@@ -140,7 +140,7 @@ class Filter {
|
|||||||
|
|
||||||
// 这个接口是否需要加密解密
|
// 这个接口是否需要加密解密
|
||||||
private checkPassEncrypt (route: string) {
|
private checkPassEncrypt (route: string) {
|
||||||
return route.startsWith('gm.') || route == 'connector.entryHandler.gmEnter';
|
return isSkipEncode(isDevelopEnv()) || route.startsWith('gm.') || route == 'connector.entryHandler.gmEnter' || route == 'gate.gateHandler.queryEntry';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 解密接口
|
// 解密接口
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { STATUS } from './../../../consts/statusCode';
|
import { STATUS } from './../../../consts/statusCode';
|
||||||
import { dispatch } from '../../../pubUtils/dispatcher';
|
import { dispatch } from '../../../pubUtils/dispatcher';
|
||||||
import { Application, BackendSession, HandlerService, } from 'pinus';
|
import { Application, BackendSession, HandlerService, pinus, } from 'pinus';
|
||||||
import { resResult } from '../../../pubUtils/util';
|
import { resResult } from '../../../pubUtils/util';
|
||||||
|
|
||||||
export default function (app: Application) {
|
export default function (app: Application) {
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import { getCityChannelSid, getGuildChannelSid, getWorldChannelSid, groupRoomId
|
|||||||
import { getAllOnlineRoles, getRoleOnlineInfo } from "./redisService";
|
import { getAllOnlineRoles, getRoleOnlineInfo } from "./redisService";
|
||||||
import { errlogger, infologger } from '../util/logger';
|
import { errlogger, infologger } from '../util/logger';
|
||||||
import { MsgEncrypt } from "../pubUtils/sysUtil";
|
import { MsgEncrypt } from "../pubUtils/sysUtil";
|
||||||
|
import { isSkipEncode } from "../pubUtils/sdkUtil";
|
||||||
|
import { isDevelopEnv } from "./utilService";
|
||||||
|
|
||||||
export async function sendMessageToAllWithSuc(route: string, data: any, filterCb?: ({ lv, topLineupCe }) => boolean) {
|
export async function sendMessageToAllWithSuc(route: string, data: any, filterCb?: ({ lv, topLineupCe }) => boolean) {
|
||||||
await sendMessageToAll(route, resResult(STATUS.SUCCESS, data), filterCb);
|
await sendMessageToAll(route, resResult(STATUS.SUCCESS, data), filterCb);
|
||||||
@@ -181,7 +183,7 @@ function encryptMsg(event: string, json: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkNotEncryptRoute(event: string) {
|
function checkNotEncryptRoute(event: string) {
|
||||||
return [
|
return isSkipEncode(isDevelopEnv()) || [
|
||||||
PUSH_ROUTE.PUSH_CURRENT_TIME,
|
PUSH_ROUTE.PUSH_CURRENT_TIME,
|
||||||
PUSH_ROUTE.RACE_START,
|
PUSH_ROUTE.RACE_START,
|
||||||
PUSH_ROUTE.GUILD_ACTIVITY_END,
|
PUSH_ROUTE.GUILD_ACTIVITY_END,
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ export interface DicServerConst {
|
|||||||
readonly TIME_STAMP_OVER: number;
|
readonly TIME_STAMP_OVER: number;
|
||||||
// 请求参数过期时间
|
// 请求参数过期时间
|
||||||
readonly ACCESS_CODE_EXPIRE_TIME: number;
|
readonly ACCESS_CODE_EXPIRE_TIME: number;
|
||||||
|
// 是否跳过加密
|
||||||
|
readonly SKIP_ENCODE: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const dicServerConst: DicServerConst = {} as DicServerConst;
|
export const dicServerConst: DicServerConst = {} as DicServerConst;
|
||||||
|
|||||||
@@ -161,4 +161,8 @@ export function isCheckWord(isDevelop = false) {
|
|||||||
|
|
||||||
export function canPay() {
|
export function canPay() {
|
||||||
return gameData.serverConst.CAN_PAY === 1;
|
return gameData.serverConst.CAN_PAY === 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isSkipEncode(isDevelop = false) {
|
||||||
|
return gameData.serverConst.SKIP_ENCODE === 1 && isDevelop;
|
||||||
}
|
}
|
||||||
@@ -21,5 +21,6 @@
|
|||||||
"DEBUG_PAY": 0,
|
"DEBUG_PAY": 0,
|
||||||
"DEBUG_TIME": 1,
|
"DEBUG_TIME": 1,
|
||||||
"CHECK_WORD": 1,
|
"CHECK_WORD": 1,
|
||||||
"CAN_PAY": 1
|
"CAN_PAY": 1,
|
||||||
|
"SKIP_ENCODE": 0
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user