diff --git a/back/data/notify.ts b/back/data/notify.ts index 4def48888a2..151266094fe 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 9646a254fab..896cf40cdd3 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);