企业微信接受消息 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
})
相关推荐
Kiri霧15 小时前
细谈kotlin中缀表达式
开发语言·微信·kotlin
红橙Darren2 天前
手写操作系统 - 环境搭建
android·微信·操作系统
陈思杰系统思考Jason3 天前
系统思考:多元胜过能力
百度·微信·微信公众平台·新浪微博·微信开放平台
今日热点4 天前
小程序主体变更全攻略:流程、资料与异常处理方案
经验分享·微信·小程序·企业微信·微信公众平台·微信开放平台
泉城老铁4 天前
SpringBoot对接微信公众号并实现消息发送功能详解
后端·微信
夏至春来-美美5 天前
微信获取access_token授权的两种不同情况
微信·php·微信公众平台
mon_star°5 天前
搭建一款结合传统黄历功能的日历小程序
微信·微信小程序·小程序·微信公众平台
呆呆的心8 天前
大厂面试官都在问的 WEUI Uploader,源码里藏了多少干货?🤔
前端·微信·面试
拖孩8 天前
微信群太多,管理麻烦?那试试接入AI助手吧~
前端·后端·微信
老蒋新思维8 天前
多门店系统:知识付费行业的规模化增长新引擎|创客匠人
微信·内容运营·创始人ip