mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 14:56:07 +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 {
|
export class ChronocatNotification extends NotificationBaseInfo {
|
||||||
public chronocatURL: string = '';
|
public chronocatURL: string = '';
|
||||||
public chronocatQQ: string = '';
|
public chronocatQQ: string = '';
|
||||||
public chronocatToekn: string = '';
|
public chronocatToken: string = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
export class WebhookNotification extends NotificationBaseInfo {
|
export class WebhookNotification extends NotificationBaseInfo {
|
||||||
|
|
|
@ -590,7 +590,7 @@ export default class NotificationService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async chronocat() {
|
private async chronocat() {
|
||||||
const { chronocatURL, chronocatQQ, chronocatToekn } = this.params;
|
const { chronocatURL, chronocatQQ, chronocatToken } = this.params;
|
||||||
try {
|
try {
|
||||||
const user_ids = chronocatQQ
|
const user_ids = chronocatQQ
|
||||||
.match(/user_id=(\d+)/g)
|
.match(/user_id=(\d+)/g)
|
||||||
|
@ -602,7 +602,7 @@ export default class NotificationService {
|
||||||
const url = `${chronocatURL}/api/message/send`;
|
const url = `${chronocatURL}/api/message/send`;
|
||||||
const headers = {
|
const headers = {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
Authorization: `Bearer ${chronocatToekn}`,
|
Authorization: `Bearer ${chronocatToken}`,
|
||||||
};
|
};
|
||||||
|
|
||||||
for (const [chat_type, ids] of [
|
for (const [chat_type, ids] of [
|
||||||
|
@ -633,7 +633,7 @@ export default class NotificationService {
|
||||||
json: data,
|
json: data,
|
||||||
headers,
|
headers,
|
||||||
});
|
});
|
||||||
if (res.body === 'success') {
|
if (res.statusCode === 200) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
throw new Error(res.body);
|
throw new Error(res.body);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user