mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
修复 chronocat 通知成功判断 (#2166)
This commit is contained in:
+1
-1
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user