From 8efce2546771b5013dcb7716623606a2f05919bf Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sat, 17 Jan 2026 15:28:25 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes --- server/notification-providers/wecom.js | 22 +++++++++++++--------- src/components/notifications/WeCom.vue | 8 +++++++- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/server/notification-providers/wecom.js b/server/notification-providers/wecom.js index 92614f5fc..e3113872e 100644 --- a/server/notification-providers/wecom.js +++ b/server/notification-providers/wecom.js @@ -19,7 +19,11 @@ class WeCom extends NotificationProvider { }; config = this.getAxiosConfigWithProxy(config); let body = this.composeMessage(notification, heartbeatJSON, msg); - await axios.post(`https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${notification.weComBotKey}`, body, config); + await axios.post( + `https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${notification.weComBotKey}`, + body, + config + ); return okMsg; } catch (error) { this.throwGeneralAxiosError(error); @@ -41,27 +45,27 @@ class WeCom extends NotificationProvider { if (msg != null && heartbeatJSON != null && heartbeatJSON["status"] === DOWN) { title = "UptimeKuma Monitor Down"; } - + let textObj = { - content: title + "\n" + msg + content: title + "\n" + msg, }; - + // Handle mentioned_mobile_list if configured if (notification.weComMentionedMobileList && notification.weComMentionedMobileList.trim()) { // Split by comma, trim whitespace, and filter out empty strings let mobileList = notification.weComMentionedMobileList .split(",") - .map(mobile => mobile.trim()) - .filter(mobile => mobile.length > 0); - + .map((mobile) => mobile.trim()) + .filter((mobile) => mobile.length > 0); + if (mobileList.length > 0) { textObj.mentioned_mobile_list = mobileList; } } - + return { msgtype: "text", - text: textObj + text: textObj, }; } } diff --git a/src/components/notifications/WeCom.vue b/src/components/notifications/WeCom.vue index b0ba41407..3183f010c 100644 --- a/src/components/notifications/WeCom.vue +++ b/src/components/notifications/WeCom.vue @@ -26,7 +26,13 @@
- +

{{ $t("WeCom Mentioned Mobile List Description") }}