校验: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

View File

@@ -48,7 +48,7 @@ export class GachaHandler {
*/
async pull(msg: { gachaId: number, activityId: number, count: number }, session: BackendSession) {
const { gachaId, activityId, count } = msg;
if (gachaId == undefined || activityId == undefined || count == undefined) return resResult(STATUS.WRONG_PARMS);
if (gachaId == undefined || activityId == undefined || count == undefined || count < 0) return resResult(STATUS.WRONG_PARMS);
const roleId: string = session.get('roleId');
const roleName: string = session.get('roleName');
const sid: string = session.get('sid');