企业微信接受消息 API 的设置

Server 可以用本地 VSCode 端口转发加 VSCode 自带的内网穿透来实现, 代码如下:

typescript 复制代码
import crypto from "node:crypto"
import { decrypt } from "@wecom/crypto"
export default defineEventHandler((event) => {
  const { msg_signature, timestamp, nonce, echostr } = getQuery(event)
  const shasum = crypto.createHash("sha1")
  const token = "---"
  const encodingAesKey = "---"
  shasum.update([token, timestamp, nonce, echostr].sort().join(""))
  const str = shasum.digest("hex")
  if (str !== msg_signature) {
    return "error"
  }
  const { message } = decrypt(encodingAesKey, echostr as string)
  return message
})
相关推荐
微信开发api-视频号协议5 小时前
Codex++安全边界探秘:从模型能力到风险防御
前端·安全·微信·企业微信
caimouse7 小时前
reactos 测试安装32位微信失败的日志
开发语言·微信
毛丫讲绘本1 天前
0-3岁选绘本需要做到越早启蒙越要简单
人工智能·学习·微信·微信公众平台·微信开放平台
中云DDoS CC防护蔡蔡1 天前
短信验证码被攻击怎么办
运维·经验分享·http·网络安全·微信
金銀銅鐵1 天前
如何在微信对话框里发送“空白”信息?
微信
张居斜11 天前
Obsidian + Claude Code + 微信AI,我把这三个系统缝进了一个软件
微信·obsidian·claude code·molio
Jinkey13 天前
要用户手机号真的是为了打骚扰电话吗?浅谈微信生态会员账号体系与资产合并
后端·微信·微信小程序
2601_9618451518 天前
粉笔行测题库|系统班|刷题
网络·百度·微信·微信公众平台·facebook·新浪微博
weikecms18 天前
聚合返利CPS小程序快速搭建教程
人工智能·微信·小程序
沉默王二20 天前
用Codex+iLink Bot API给Agent接入微信,基于这个开源Skill
微信·agent·claude