企业微信接受消息 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
})
相关推荐
开开心心_Every10 小时前
强制打字练习工具:打够百字才可退出
java·游戏·微信·eclipse·pdf·excel·语音识别
开开心心_Every10 小时前
多端免费远程控制工具:4K流畅同账号直连
游戏·macos·微信·pdf·excel·语音识别·phpstorm
WindHunter6152 天前
越是非标项目,越要先签“需求确认书”
经验分享·微信·制造·微信公众平台
羊群智妍3 天前
跨境、合规、垂类全覆盖 2026 GEO五强服务商适配指南
百度·微信·微信公众平台·新浪微博·segmentfault
sheji34163 天前
【开题答辩全过程】以 微信小程网上书店为例,包含答辩的问题和答案
微信
kyh10033811204 天前
第二个微信小游戏《汉字碰碰消》上线啦!
微信·微信小程序·微信小游戏·去水印微信小程序·养了个羊
kyh10033811204 天前
汉字消除微信小游戏实现教程
微信·微信小游戏·小游戏源码·消除小游戏
陈思杰系统思考Jason4 天前
系统思考:飞轮效应与系统结构
百度·微信·微信公众平台·新浪微博·微信开放平台
YJlio4 天前
WinObj 学习笔记(15.7):看懂内核对象管理器与命名空间的“地图”
linux·服务器·网络·windows·笔记·学习·微信
陈思杰系统思考Jason5 天前
系统思考:复盘第一性原理
百度·微信·微信公众平台·新浪微博·微信开放平台