参数错误拦截

This commit is contained in:
luying
2021-01-27 16:00:49 +08:00
committed by liangtongchuan
parent 2d7106e599
commit da86ba4930
3 changed files with 8 additions and 2 deletions
@@ -66,7 +66,7 @@ export class DailyBattleHandler {
// 购买每日次数
async buyNum(msg: { type: number, count: number }, session: BackendSession) {
let {type, count} = msg;
if(count < 0) return resResult(STATUS.WRONG_PARMS);
if( !count || count < 0) return resResult(STATUS.WRONG_PARMS);
const roleId = session.get('roleId');
const sid = session.get('sid');
@@ -35,7 +35,7 @@ export class DungeonBattleHandler {
// 购买每日次数
async buyNum(msg: { count: number }, session: BackendSession) {
let { count } = msg;
if(count < 0) return resResult(STATUS.WRONG_PARMS);
if( !count || count < 0) return resResult(STATUS.WRONG_PARMS);
const roleId = session.get('roleId');
const sid = session.get('sid');