企业微信接受消息 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
})
相关推荐
漫无目的行走的月亮7 天前
测试微信模版消息推送
微信·模版消息
假客套7 天前
2025 后端自学UNIAPP【项目实战:旅游项目】6、我的收藏页面
微信·uni-app·旅游
七分小熊猫12 天前
解决ios页面跳转后调用微信js-sdk签名认证失败
vue.js·微信
鹏北海13 天前
Vue3+TS的H5项目实现微信分享卡片样式
前端·微信
陈思杰系统思考Jason13 天前
系统思考:短期利益与长期系统影响
百度·微信·微信公众平台·新浪微博·微信开放平台
悠米来了13 天前
微信个人api接口
微信·机器人
FE_C_P小麦16 天前
AI中国象棋双人游戏开发尝试:AI_Grok
前端·微信·微信小程序
沃野_juededa21 天前
uniapp 开发安卓app 微信授权获取昵称 头像登录
微信·uni-app
PyAIGCMaster21 天前
项目 react+taro 编写的微信 小程序,什么命令,可以减少console的显示
react.js·微信·taro
说私域22 天前
基于开源AI大模型与智能硬件的零售场景服务创新研究——以AI智能名片与S2B2C商城小程序源码融合为例
人工智能·微信·小程序·开源·零售·智能硬件