企业微信接受消息 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
})
相关推荐
羊群智妍1 天前
2026年GEO新趋势:如何利用免费工具进行AI搜索优化
百度·微信·微信公众平台·facebook·新浪微博
陈思杰系统思考Jason2 天前
系统思考与业务高管局限
百度·微信·微信公众平台·新浪微博·微信开放平台
AI周红伟3 天前
OpenClaw是什么?OpenClaw能做什么?OpenClaw详细介绍及保姆级部署教程-周红伟
大数据·运维·服务器·人工智能·微信·openclaw
Soujer4 天前
支持微信4.0的小程序注入调试工具(WMPFDebugger)
微信·小程序
取码网4 天前
最新电子商务购物商城系统源码 三端_H5+微信+安卓
微信
陈思杰系统思考Jason5 天前
系统思考:短视决策与长期风险
百度·微信·微信公众平台·新浪微博·微信开放平台
孙严Pay5 天前
快捷支付和网关支付,到底有啥不一样?
笔记·科技·计算机网络·其他·微信
羊群智妍5 天前
2026年AI搜索优化/GEO技术演进:行业趋势与落地实践
百度·微信·微信公众平台·facebook·新浪微博
奇迹婉婉6 天前
微信机器人开发实战:从0到1搭建智能客服系统
微信·api·微信机器人
TE-茶叶蛋6 天前
安卓应用(uniapp开发)分享微信-申请appid
android·微信·uni-app