企业微信接受消息 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
})
相关推荐
开发加微信:hedian1165 天前
微信推客小程序系统开发技术实践
微信·小程序
低调小一7 天前
Swift 语法学习指南 - 与 Kotlin 对比
微信·kotlin·swift
黑马源码库miui520867 天前
JAVA同城打车小程序APP打车顺风车滴滴车跑腿源码微信小程序打车源码
java·微信·微信小程序·小程序·uni-app
悟空码字7 天前
微信开放平台第三方平台,可以管理多个微信小程序
微信·小程序·开放平台
JohnYan8 天前
工作笔记 - 微信消息发送和处理
javascript·后端·微信
@Dai8 天前
MacOS微信双开,亲测有效
macos·微信
從南走到北8 天前
JAVA同城打车小程序APP打车顺风车滴滴车跑腿源码微信小程序打车源码
java·开发语言·微信·微信小程序·小程序
小溪彼岸10 天前
微信发布新功能,可以在公众号和视频号@元宝了
微信·腾讯
肾透侧视攻城狮12 天前
从淘宝推荐到微信搜索:查找算法如何支撑亿级用户——动画可视化
算法·微信