From 48cd24d309b9209d87df05ae9d6a8913bd6e6bea Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Thu, 11 Jan 2024 18:45:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=B6=85=E5=80=BC=E5=9F=BA=E9=87=91?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=A5=96=E5=8A=B1=E9=80=BB=E8=BE=91=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=BA=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/yuedujijin/ApiRec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api_s2c/event/yuedujijin/ApiRec.ts b/src/api_s2c/event/yuedujijin/ApiRec.ts index 039f191..0db9481 100644 --- a/src/api_s2c/event/yuedujijin/ApiRec.ts +++ b/src/api_s2c/event/yuedujijin/ApiRec.ts @@ -16,8 +16,8 @@ export default async function (call: ApiCall) { if (call.req.index > day) return call.errorCode(-3); if (rec.includes(call.req.index)) return call.errorCode(-4); - - G.mongodb.cEvent(type).updateOne({uid: call.uid, type: type}, {$push: {rec: call.req.index}}, {upsert: true}); + // 从异步改成同步 + await G.mongodb.cEvent(type).updateOne({uid: call.uid, type: type}, {$push: {rec: call.req.index}}, {upsert: true}); await PlayerFun.sendPrize(call, [].concat(conf.prize[call.req.index]));