feat: 添加企业微信消息推送功能

This commit is contained in:
huzhengrong 2025-10-23 18:11:53 +08:00
parent 2476f51121
commit 981d7f1c2a
1 changed files with 20 additions and 0 deletions

View File

@ -250,6 +250,25 @@ function dealNullAndUndefined(value) {
if (value == "undefined") return "";
return value;
}
// 企业微信消息推送
async function sendQYWechatMessage(message) {
try {
const webhook = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=7de26c43-8652-4204-9665-47a5cef58b58";
await axios.post(webhook, {
msgtype: "text",
text: {
content: message
}
}, {
headers: {
'Content-Type': 'application/json'
}
});
console.log(`${this.key}-企业微信消息推送成功: ${message}`);
} catch (error) {
console.error(`${this.key}-企业微信消息推送失败:`, error.message);
}
}
export {
timestampToDate,
loopCall,
@ -258,5 +277,6 @@ export {
parseToGgDetailsParams,
addToMessageQueue,
md5,
sendQYWechatMessage
// wechatPush
};