✨ feat: 添加企业微信消息推送功能
This commit is contained in:
parent
2476f51121
commit
981d7f1c2a
20
utils.js
20
utils.js
|
|
@ -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
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue