企业微信接受消息 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
})
相关推荐
随性而行3602 天前
企业微信API调用案例:如何通过接口实现多账号统一管理与业务接入?
运维·微信·机器人·自动化·企业微信
随性而行3602 天前
企业微信API接口开发实战:如何实现消息回调接收与业务事件处理?
java·前端·python·微信·机器人·企业微信
Eddyp2 天前
涡街 电磁流量计、压力变送器,手操器组态实操要点
微信·微信公众平台·facebook·新浪微博·微信开放平台
后除3 天前
Go 实战: 使用 Wails v2.15 构建轻量级的桌面应用 - 仿微信登录界面
开发语言·微信·golang
GeWeAPI技术支持3 天前
个人微信API二次开发:如何给消息回调增加异常日志和排查线索
人工智能·微信
凡泰极客科技4 天前
如何让企业App像微信一样,运行短剧、外卖和小游戏?
微信
老三牛擦5 天前
业财一体化
微信
9624566 天前
微信第三方平台 component_access_token 间歇性过期故障技术复盘
微信
加我攻城狮8 天前
当大模型把「景区」定位到附近公共厕所:我的 AI 旅行小程序踩坑实录
后端·微信
开开心心_Every8 天前
电脑OCR识别软件支持表格识别图片转Excel
java·开发语言·微信·计算机外设·ocr·intellij-idea·excel