From 981d7f1c2ada311e21a19fca41daca7ff5873f5b Mon Sep 17 00:00:00 2001 From: huzhengrong Date: Thu, 23 Oct 2025 18:11:53 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E6=B7=BB=E5=8A=A0=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/utils.js b/utils.js index 77d251c..0237182 100644 --- a/utils.js +++ b/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 };