mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
修复 chronocat 通知成功判断 (#2166)
This commit is contained in:
parent
9f6d4943ea
commit
82c9978514
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user