From 82c99785143aaf2e7bb45b8974567808128c2372 Mon Sep 17 00:00:00 2001 From: Bad Child Date: Fri, 3 Nov 2023 17:57:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20chronocat=20=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E6=88=90=E5=8A=9F=E5=88=A4=E6=96=AD=20(#2166)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/data/notify.ts | 2 +- back/services/notify.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/back/data/notify.ts b/back/data/notify.ts index 4def4888..15126609 100644 --- a/back/data/notify.ts +++ b/back/data/notify.ts @@ -112,7 +112,7 @@ export class PushMeNotification extends NotificationBaseInfo { export class ChronocatNotification extends NotificationBaseInfo { public chronocatURL: string = ''; public chronocatQQ: string = ''; - public chronocatToekn: string = ''; + public chronocatToken: string = ''; } export class WebhookNotification extends NotificationBaseInfo { diff --git a/back/services/notify.ts b/back/services/notify.ts index 9646a254..896cf40c 100644 --- a/back/services/notify.ts +++ b/back/services/notify.ts @@ -590,7 +590,7 @@ export default class NotificationService { } private async chronocat() { - const { chronocatURL, chronocatQQ, chronocatToekn } = this.params; + const { chronocatURL, chronocatQQ, chronocatToken } = this.params; try { const user_ids = chronocatQQ .match(/user_id=(\d+)/g) @@ -602,7 +602,7 @@ export default class NotificationService { const url = `${chronocatURL}/api/message/send`; const headers = { 'Content-Type': 'application/json', - Authorization: `Bearer ${chronocatToekn}`, + Authorization: `Bearer ${chronocatToken}`, }; for (const [chat_type, ids] of [ @@ -633,7 +633,7 @@ export default class NotificationService { json: data, headers, }); - if (res.body === 'success') { + if (res.statusCode === 200) { return true; } else { throw new Error(res.body);