企业微信接受消息 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
})
相关推荐
攻城狮_3 小时前
微信HOOK 实现自动下载视频
微信·微信hook·vx·微信pc版
扛麻袋的少年2 天前
7.Kotlin的日期类
开发语言·微信·kotlin
JohnYan8 天前
工作笔记 - 一次微信认证集成迁移
后端·安全·微信
摸着石头过河的石头10 天前
微信h5页面开发遇到的坑
前端·微信
悟空码字12 天前
老婆说要是能做个育儿补贴计算小程序就生二胎?用腾讯云代码助手CodeBuddy立马手戳了一个
微信
阿彬爱学习13 天前
AI 大模型企业级应用落地挑战与解决方案
人工智能·算法·微信·chatgpt·开源
王小发10116 天前
怎么打败微信内置浏览器的恐怖缓存
前端·微信
qq_256847888618 天前
oelove奥壹新版v11.7旗舰版婚恋系统微信原生小程序源码上架容易遇到的几个坑,避免遗漏参数白屏显示等问题
微信·奥壹原生小程序源码·奥壹婚恋交友系统小程序·oelove婚恋交友小程序源码·婚恋交友开源版·奥壹小程序上架设置
gongzemin24 天前
微信第三方平台的配置
微信·微信小程序·资讯
劫大大25 天前
前端开发公众号或服务号,本地怎么与后端测试服接口打通呢
前端·微信