From 6a6db4a445ac6b243663f2494a58bc4fa8476643 Mon Sep 17 00:00:00 2001 From: zhizhi200271 Date: Fri, 13 Mar 2026 18:22:57 +0800 Subject: [PATCH] =?UTF-8?q?DEV-004:=20M-DINGTALK=20Phase6=20=E5=85=AC?= =?UTF-8?q?=E7=BD=91=E9=83=A8=E7=BD=B2+=E9=92=89=E9=92=89=E7=9C=9F?= =?UTF-8?q?=E5=AE=9E=E5=AF=B9=E6=8E=A5=20=C2=B7=20=E5=8D=81=E4=B8=83?= =?UTF-8?q?=E8=BF=9E=E8=83=9C=E8=BE=BE=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dingtalk-bot/index.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dingtalk-bot/index.js b/dingtalk-bot/index.js index 5eb39d91..ca41b076 100644 --- a/dingtalk-bot/index.js +++ b/dingtalk-bot/index.js @@ -204,3 +204,25 @@ app.get('/api/notion/status', async function(req, res) { console.log('=== Phase 3 初始化完成 ===\n'); }); + +// ======================== +// Phase 6 路由 · 钉钉真实回调 +// ======================== +var dingWebhook = require('./dingtalk-webhook'); + +// 钉钉消息回调(POST · 钉钉服务器发来的真实消息) +app.post('/dingtalk/callback', dingWebhook.verifyMiddleware, dingWebhook.handleCallback); + +// 回调地址健康检查(GET · 钉钉后台验证用) +app.get('/dingtalk/callback', dingWebhook.healthCheck); + +// 回调状态总览 +app.get('/api/dingtalk/callback-status', function(req, res) { + var configured = !!process.env.DINGTALK_APP_SECRET && process.env.DINGTALK_APP_SECRET !== '在这里粘贴你的AppSecret'; + res.json({ + callback_active: true, + signature_verification: configured ? 'enabled' : 'disabled (dev mode)', + endpoint: '/dingtalk/callback', + phase: 6 + }); +});