From 944ef41d5d8cd10bdd57731400fc4f747c55b18e Mon Sep 17 00:00:00 2001 From: dy Date: Wed, 27 Dec 2023 09:51:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=BE=E6=91=A9=E7=8C=AE=E7=A4=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuandan/ApiDMRec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api_s2c/event/yuandan/ApiDMRec.ts b/src/api_s2c/event/yuandan/ApiDMRec.ts index b0ddea0..6db04dd 100644 --- a/src/api_s2c/event/yuandan/ApiDMRec.ts +++ b/src/api_s2c/event/yuandan/ApiDMRec.ts @@ -11,7 +11,7 @@ export default async function (call: ApiCall) { // 奖励不符合 let toPrize = call.req.prize - let prize = _hd.data.game.find(i => i.a == toPrize.a && i.t == toPrize.t && i.n == toPrize.n) + let prize = _hd.data.game.find(i => i.a == toPrize?.a && i.t == toPrize?.t && i.n == toPrize?.n) if (toPrize && !prize) return call.errorCode(-4) // 扣除免费次数或相应货币 @@ -23,8 +23,8 @@ export default async function (call: ApiCall) { await PlayerFun.cutNeed(call, _hd.data.gameneed); } - if (prize){ - await PlayerFun.sendPrize(call, [prize] ); + if (prize) { + await PlayerFun.sendPrize(call, [prize]); } await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, {