From f70c16be5243d305eae7aa92b8f6cba25917b52e Mon Sep 17 00:00:00 2001 From: hanhh <18330117883@163.com> Date: Thu, 20 May 2021 22:17:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dck=E5=90=AF=E7=94=A8=E7=A6=81?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/services/cookie.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/back/services/cookie.ts b/back/services/cookie.ts index 802ec192..016b4052 100644 --- a/back/services/cookie.ts +++ b/back/services/cookie.ts @@ -193,10 +193,14 @@ export default class CookieService { public async remove(ids: string[]) { return new Promise((resolve: any) => { - this.cronDb.remove({ _id: { $in: ids } }, {}, async (err) => { - await this.set_cookies(); - resolve(); - }); + this.cronDb.remove( + { _id: { $in: ids } }, + { multi: true }, + async (err) => { + await this.set_cookies(); + resolve(); + }, + ); }); } @@ -287,12 +291,12 @@ export default class CookieService { }); } - public async disabled(ids: string) { + public async disabled(ids: string[]) { return new Promise((resolve: any) => { this.cronDb.update( { _id: { $in: ids } }, { $set: { status: CookieStatus.disabled } }, - {}, + { multi: true }, async (err) => { await this.set_cookies(); resolve(); @@ -301,12 +305,12 @@ export default class CookieService { }); } - public async enabled(ids: string) { + public async enabled(ids: string[]) { return new Promise((resolve: any) => { this.cronDb.update( { _id: { $in: ids } }, { $set: { status: CookieStatus.noacquired } }, - {}, + { multi: true }, async (err, num) => { await this.set_cookies(); resolve();