防护:接口访问限制

This commit is contained in:
luying
2022-01-08 18:15:25 +08:00
parent 0f8a4a946e
commit e793e8bc94
6 changed files with 45 additions and 24 deletions
+2 -1
View File
@@ -169,7 +169,8 @@ app.configure(ALL_ENVS, 'activity', function () {
function errorHandler(err: Error, msg: any, resp: any,
session: FrontendOrBackendSession, cb: HandlerCallback) {
const errCode = genCode(10);
errlogger.error(`${pinus.app.serverId} error handler \n msg[${JSON.stringify(msg)}] \n resp[${JSON.stringify(resp)}] \n sessionId:${JSON.stringify(session.export())} \n error 【${errCode}】 stack: ${err.stack}`);
if(err.message != 'globalFilter')
errlogger.error(`${pinus.app.serverId} error handler \n msg[${JSON.stringify(msg)}] \n resp[${JSON.stringify(resp)}] \n sessionId:${JSON.stringify(session.export())} \n error 【${errCode}】 stack: ${err.stack}`);
if (!resp) {
resp = resResult(STATUS.GLOBAL_ERR, { errCode, stack: err.stack });