企业微信接受消息 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
})
相关推荐
羊群智妍17 小时前
2026年GEO服务商推荐:SheepGeo免费AI搜索优化监测工具
百度·微信·微信公众平台·facebook·新浪微博
Ealrang1 天前
openclaw连微信看不到二维码的看这里
微信
一个人旅程~1 天前
虚数与量子迷踪
经验分享·笔记·微信·电脑·量子计算
feelling2 天前
微信官方接入 OpenClaw?我 10 分钟搞定了,但过程中这几个坑你必须知道
微信
陈思杰系统思考Jason2 天前
系统思考:结构性缺陷与企业波动
百度·微信·微信公众平台·新浪微博·微信开放平台
陈思杰系统思考Jason3 天前
动态博弈中的系统思考
百度·微信·微信公众平台·新浪微博·微信开放平台
Refly3 天前
【微信接入 OpenClaw 龙虾🦞】10分钟手把手教程完成接入,Claude 模型无限使用
前端·微信·github
AI袋鼠帝3 天前
劲爆!个人微信官方接入龙虾了【喂饭级教程】
人工智能·微信
羊群智妍3 天前
2026年免费GEO监测工具指南:SheepGeo解锁国内AI搜索优化
百度·微信·微信公众平台·facebook·新浪微博
陈思杰系统思考Jason5 天前
战略选择:挖坑与打井
百度·微信·微信公众平台·新浪微博·微信开放平台