企业微信接受消息 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_YXQ4 小时前
Unity无GC读取图片与网格完整方案
大数据·人工智能·unity·微信·产品运营
山川而川-R11 小时前
调用微信开源二维码模型
微信·开源
凌涘1 天前
依托 BEM 规范深度剖析 WeUI 微信按钮组件开发与实现
前端·微信
m0_696212682 天前
如何用微信 API 实现多群消息同步和定时群发
微信
罗光记2 天前
Solon Server 启动模式深度解析:从 0.3MB 内核到 10+ Server 插件
其他·百度·微信·微信公众平台·新浪微博
阳明山水5 天前
销量预测模型评估进阶:从 MAPE 到库存周转率与缺货损失金额
人工智能·机器学习·微信·微信公众平台·微信开放平台
wan55cn@126.com5 天前
调试协作之歌
人工智能·笔记·微信
柚鸥ASO优化7 天前
微信正在变成“搜索引擎”:小程序SEO机会全面爆发
搜索引擎·微信·小程序·小程序优化
写了20年代码的老程序员8 天前
企业微信、飞书、钉钉 Webhook 接入,后端代码为什么总是越写越丑
java·微信
px不是xp10 天前
【灶台导航】个人中心模块开发实战
javascript·微信·腾讯云·notepad++