Skip to content

Commit

Permalink
修复 chronocat 通知成功判断 (#2166)
Browse files Browse the repository at this point in the history
  • Loading branch information
youfak authored Nov 3, 2023
1 parent 9f6d494 commit 82c9978
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion back/data/notify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions back/services/notify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 [
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 82c9978

Please sign in to comment.