企业微信接受消息 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
})
相关推荐
2601_961845153 天前
粉笔行测题库|系统班|刷题
网络·百度·微信·微信公众平台·facebook·新浪微博
weikecms3 天前
聚合返利CPS小程序快速搭建教程
人工智能·微信·小程序
沉默王二5 天前
用Codex+iLink Bot API给Agent接入微信,基于这个开源Skill
微信·agent·claude
Szime6 天前
小批量电子元器件采购为什么更难?从研发打样到试产交付
微信
五月君_6 天前
安卓也支持了!微信链接 Claude Code 保姆级教程
android·微信
人道领域6 天前
为什么iPhone微信聊天记录搜不到“?“,而安卓可以。
android·微信·iphone
weikecms9 天前
消费返物业费 + 小区本地生活 CPS 系统|微客云(物业 / 社区 / 本地服务商首选)
人工智能·微信·微客云
Thomas_YXQ10 天前
Unity3D Addressable 深度优化热更性能消耗
开发语言·3d·unity·微信
@Ma11 天前
企业微信外部群机器人接入 AI:一套能落地的工程方案
微信·机器人
2601_9611940211 天前
27考研资料|免费全套|电子版
考研·百度·微信·pdf·微信公众平台·facebook·新浪微博