企业微信接受消息 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
})
相关推荐
打破砂锅问到底0075 小时前
AI 驱动开发实战:10分钟从零构建「微信群相册」小程序
人工智能·微信·小程序·ai编程
羊群智妍15 小时前
2026 AI搜索流量密码:免费GEO监测工具,优化效果看得见
笔记·百度·微信·facebook·新浪微博
陈思杰系统思考Jason20 小时前
系统思考与组织效率
百度·微信·微信公众平台·新浪微博·微信开放平台
KIKIiiiiiiii1 天前
微信个人号API二次开发中的解决经验
java·人工智能·python·微信
绝缘体12 天前
如何使用外卖霸王餐api接口?
大数据·搜索引擎·微信·pygame
新时代牛马2 天前
CANopen 协议详解
linux·微信
陈思杰系统思考Jason3 天前
系统问题误作态度问题
百度·微信·微信公众平台·新浪微博·微信开放平台
开开心心_Every3 天前
音频视频转文字工具,离线语音识别免费
人工智能·游戏·微信·pdf·excel·语音识别·memcache
开开心心_Every3 天前
电脑网速加速工具,无线有线叠加网络
网络·游戏·微信·pdf·电脑·excel·语音识别
弓乙图4 天前
三丰主字图,田字出头出尾申字图
经验分享·微信