系统:添加1003报错返回

This commit is contained in:
luying
2021-04-21 17:07:30 +08:00
parent 1c127afe5e
commit 1dc2be9230
2 changed files with 4 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
require('xprofiler').start(); require('xprofiler').start();
import { COM_TEAM_STATUS } from './app/consts'; import { COM_TEAM_STATUS, STATUS } from './app/consts';
import { import {
createTcpAcceptor, createTcpAcceptor,
createTcpMailBox, createTcpMailBox,
@@ -23,7 +23,7 @@ import * as redLockService from './app/services/redLockService';
import _pinus = require('pinus'); import _pinus = require('pinus');
import { updateTeamStatus } from './app/services/comBattleService'; import { updateTeamStatus } from './app/services/comBattleService';
import { init } from './app/pubUtils/gmData/gmDataUtil'; import { init } from './app/pubUtils/gmData/gmDataUtil';
import { gameData } from './app/pubUtils/data'; import { resResult } from './app/pubUtils/util';
const filePath = (_pinus as any).FILEPATH; const filePath = (_pinus as any).FILEPATH;
filePath.MASTER = '/config/master'; filePath.MASTER = '/config/master';
filePath.SERVER = '/config/servers'; filePath.SERVER = '/config/servers';
@@ -149,7 +149,7 @@ function errorHandler(err: Error, msg: any, resp: any,
to resolve unknown exception: sessionId:${ JSON.stringify(session.export()) } , to resolve unknown exception: sessionId:${ JSON.stringify(session.export()) } ,
error stack: ${ err.stack }`); error stack: ${ err.stack }`);
if (!resp) { if (!resp) {
resp = { code: 1003 }; resp = resResult(STATUS.GLOBAL_ERR);
} }
cb(err, resp); cb(err, resp);
} }

View File

@@ -7,6 +7,7 @@ export const STATUS = {
CONNECTOR_ERR: { code: 4, simStr: '连接服配置错误' }, CONNECTOR_ERR: { code: 4, simStr: '连接服配置错误' },
LOGIN_ERR: { code: 5, simStr: '检测到您的账号异地登录,已被迫下线' }, LOGIN_ERR: { code: 5, simStr: '检测到您的账号异地登录,已被迫下线' },
REDLOCK_ERR: { code: 6, simStr: 'redlock错误' }, REDLOCK_ERR: { code: 6, simStr: 'redlock错误' },
GLOBAL_ERR: { code: 1003, simStr: '服务器内部错误' },
// 账号相关状态 10000 - 19999 // 账号相关状态 10000 - 19999
SMS_IN_60S: { code: 10001, simStr: '60秒内只能发送一次' }, SMS_IN_60S: { code: 10001, simStr: '60秒内只能发送一次' },