校验:count不应为负数的校验

This commit is contained in:
luying
2022-06-10 14:42:30 +08:00
parent 704560a37f
commit c74865e315
13 changed files with 28 additions and 15 deletions
@@ -107,6 +107,7 @@ export class RoleHandler {
//神像强化
async roleTeraphStrengthen(msg: { id: number, count: number }, session: BackendSession) {
let { id, count } = msg;
if( count < 0) return resResult(STATUS.WRONG_PARMS);
let roleId = session.get('roleId');
let sid: string = session.get('sid');
let serverId: number = session.get('serverId');
@@ -42,6 +42,7 @@ export class ShopHandler {
let serverId = session.get('serverId');
let { shopItemId, count } = msg;
if( count < 0) return resResult(STATUS.WRONG_PARMS);
let dicShopItem = gameData.shopItem.get(shopItemId);
if(!dicShopItem) return resResult(STATUS.DIC_DATA_NOT_FOUND);