From 08718a9701a470b1f44fa6d6910ddbf2be61b1eb Mon Sep 17 00:00:00 2001 From: Teror Fox Date: Sat, 22 Mar 2025 16:11:04 +0800 Subject: [PATCH] refactor(notification-providers): improve code for pushplus --- server/notification-providers/pushplus.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/server/notification-providers/pushplus.js b/server/notification-providers/pushplus.js index d76d2273e..9cceec3e4 100644 --- a/server/notification-providers/pushplus.js +++ b/server/notification-providers/pushplus.js @@ -7,11 +7,15 @@ class PushPlus extends NotificationProvider { /** * @inheritdoc + * @param {BeanModel} notification Notification object + * @param {string} msg Message content + * @param {?object} monitorJSON Monitor details + * @param {?object} heartbeatJSON Heartbeat details + * @returns {Promise} Success message */ - async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { const okMsg = "Sent Successfully."; - const url = `https://www.pushplus.plus/send`; + const url = "https://www.pushplus.plus/send"; try { await axios.post(url, { "token": notification.pushPlusSendKey, @@ -19,7 +23,7 @@ class PushPlus extends NotificationProvider { "content": msg, "template": "html" }, { headers: { "Content-Type": "application/json" } } - ); + ); return okMsg; } catch (error) { @@ -47,4 +51,4 @@ class PushPlus extends NotificationProvider { } } -module.exports = PushPlus; \ No newline at end of file +module.exports = PushPlus;