[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot] 2026-01-17 15:28:25 +00:00 committed by GitHub
parent 27f68ef52d
commit 8efce25467
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 10 deletions

View File

@ -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,
};
}
}

View File

@ -26,7 +26,13 @@
<div class="mb-3">
<label for="wecom-mentioned-mobile-list" class="form-label">{{ $t("WeCom Mentioned Mobile List") }}</label>
<input id="wecom-mentioned-mobile-list" v-model="$parent.notification.weComMentionedMobileList" type="text" class="form-control" placeholder="13800001111,13900002222,@all">
<input
id="wecom-mentioned-mobile-list"
v-model="$parent.notification.weComMentionedMobileList"
type="text"
class="form-control"
placeholder="13800001111,13900002222,@all"
/>
<p class="form-text">{{ $t("WeCom Mentioned Mobile List Description") }}</p>
</div>
</template>