From 15ffdf5e473915c8424e0db219a1c91ef79c6db3 Mon Sep 17 00:00:00 2001 From: luying Date: Tue, 15 Jun 2021 13:58:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=EF=BC=9A=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E5=88=9B=E5=BB=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gm-server/app/service/Activity.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gm-server/app/service/Activity.ts b/gm-server/app/service/Activity.ts index fd6a53f9e..a2da2d78b 100644 --- a/gm-server/app/service/Activity.ts +++ b/gm-server/app/service/Activity.ts @@ -31,11 +31,9 @@ export default class Activity extends Service { public async checkActivityEditable(activityId: number) { let now = new Date(); let activity = await ActivityModel.findActivity(activityId); - if(!activity) { - return this.ctx.service.utils.resResult(STATUS.ACTIVITY_MISSING); - } + if(this.app.config.env == 'production') { - if(activity.beginTime < now && activity.endTime > now) { + if(!activity || (activity.beginTime < now && activity.endTime > now)) { if(activity.type == ACTIVITY_TYPE.SIGN_IN || activity.type == ACTIVITY_TYPE.SIGN_IN_VIP) { // 签到活动的不显示期内也可以编辑