From 4968dae33e0021a309e5721a766330b8496c2e3c Mon Sep 17 00:00:00 2001 From: CounterFire2023 <136581895+CounterFire2023@users.noreply.github.com> Date: Wed, 27 Mar 2024 13:40:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=8E=AF=E5=A2=83=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E7=BB=99=E8=87=AA=E5=B7=B1=E5=8A=A9=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/chest.controller.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controllers/chest.controller.ts b/src/controllers/chest.controller.ts index 8067b36..17249d2 100644 --- a/src/controllers/chest.controller.ts +++ b/src/controllers/chest.controller.ts @@ -101,7 +101,8 @@ class BoxController extends BaseController { if (chest.status === ChestStatusEnum.LOCKED) { throw new ZError(14, 'chest is locked') } - if (chest.user === uid) { + // 生产环境不能助力自己 + if (process.env.NODE_ENV === 'production' && chest.user === uid) { throw new ZError(15, 'can not enhance self') } const score = Math.floor(Math.random() * (chest.bounsCfg[1] - chest.bounsCfg[0] + 1) + chest.bounsCfg[0])