企业微信接受消息 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
})
相关推荐
Thomas_YXQ15 小时前
Unity3D Addressable 深度优化热更性能消耗
开发语言·3d·unity·微信
@Ma1 天前
企业微信外部群机器人接入 AI:一套能落地的工程方案
微信·机器人
2601_961194022 天前
27考研资料|免费全套|电子版
考研·百度·微信·pdf·微信公众平台·facebook·新浪微博
凌奕2 天前
微信小程序接入微信 AI:让用户"说一句话"就能下单
微信·微信小程序·agent
弓乙图4 天前
弓乙歌/岐黄真源赋
经验分享·微信
2601_961194024 天前
初中英语教资笔试资源|科三教案模板和知识点资料
百度·微信·微信公众平台·facebook·twitter·新浪微博
梁辰兴4 天前
微信小程序开发者工具下载与安装
微信·微信小程序·小程序·教程·软件安装·开发者工具
Thomas_YXQ6 天前
Unity无GC读取图片与网格完整方案
大数据·人工智能·unity·微信·产品运营
山川而川-R7 天前
调用微信开源二维码模型
微信·开源
凌涘7 天前
依托 BEM 规范深度剖析 WeUI 微信按钮组件开发与实现
前端·微信