企业微信接受消息 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
})
相关推荐
孙严Pay2 小时前
分享三种不同的支付体验,各自有着不同的特点与适用场景。
笔记·科技·计算机网络·其他·微信
资深数据库专家5 小时前
window 11 检测到一个 TDI 筛选器(\Driver\gwredirector)。该筛选器尚未通过 Microsoft 认证 。 如何解决
经验分享·微信·微信公众平台·新浪微博
陈思杰系统思考Jason9 小时前
2025年的自己
百度·微信·微信公众平台·新浪微博·微信开放平台
梦想的旅途213 小时前
企业微信开发笔记:外部群主动推送消息的逻辑实现
微信·自动化·企业微信
弓乙图17 小时前
金刚经的核心思想
经验分享·微信
陈思杰系统思考Jason2 天前
系统思考:人性的洞察
百度·微信·微信公众平台·新浪微博·微信开放平台
微爱帮监所写信寄信3 天前
微爱帮监狱寄信写信系统后台PHP框架优化实战手册
android·开发语言·人工智能·网络协议·微信·https·php
AmsWait3 天前
微信H5订阅消息接入实战:样式错乱、返回值解析报错?避坑指南来了
javascript·微信
说私域3 天前
基于电商平台直播板块的智能名片链动2+1模式商城小程序应用研究
人工智能·微信·小程序·开源