From b933e82e488119975f12a20f68a42f22dd63110d Mon Sep 17 00:00:00 2001 From: Alone88 Date: Thu, 21 Mar 2024 13:22:30 +0800 Subject: [PATCH] Update WPush Notification Provider Co-authored-by: Frank Elsinga --- server/notification-providers/wpush.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/notification-providers/wpush.js b/server/notification-providers/wpush.js index 9b60365d..21fd37f0 100644 --- a/server/notification-providers/wpush.js +++ b/server/notification-providers/wpush.js @@ -12,14 +12,15 @@ class WPush extends NotificationProvider { const okMsg = "Sent Successfully."; try { - const ret = await axios.post("https://api.wpush.cn/api/v1/send", { + const context = { "title": this.checkStatus(heartbeatJSON, monitorJSON), "content": msg, "apikey": notification.wpushAPIkey, "channel": notification.wpushChannel - }); - if (ret.data.code !== 0) { - return ret.data.message; + }; + const result = await axios.post("https://api.wpush.cn/api/v1/send", context); + if (result.data.code !== 0) { + throw response.data.message; } return okMsg;