From 3178c96b3556dbb1214fd51e3b4e63a33096fc33 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 5 Apr 2026 10:28:02 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20V2=E8=AE=A2=E9=98=85=E5=8F=91=E9=80=81?= =?UTF-8?q?=E7=BC=BA=E5=B0=91send=E5=8F=82=E6=95=B0=20+=20URL=E8=A6=86?= =?UTF-8?q?=E7=9B=96=E6=9C=AA=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 工作流调用send-subscription.js时遗漏send命令参数, 导致邮箱被解析为操作名触发"未知操作"错误。 同时修复generateSubscriptionEmail不接受URL覆盖参数的问题, 使V2工作流传入的/api/proxy-v2/路径正确用于邮件内容。 Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/c366b233-2a6b-4347-bb66-9013b9af3629 Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> --- .github/workflows/deploy-brain-proxy.yml | 2 +- server/proxy/service/send-subscription.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-brain-proxy.yml b/.github/workflows/deploy-brain-proxy.yml index 219173ab..809b70bc 100644 --- a/.github/workflows/deploy-brain-proxy.yml +++ b/.github/workflows/deploy-brain-proxy.yml @@ -303,7 +303,7 @@ jobs: ${{ secrets.ZY_BRAIN_USER }}@${{ secrets.ZY_BRAIN_HOST }} \ "export ZY_SMTP_USER='${ZY_SMTP_USER}' ZY_SMTP_PASS='${ZY_SMTP_PASS}' && \ cd /opt/zhuyuan-brain/proxy && \ - node service/send-subscription.js '$EMAIL' '$SUB_URL'" || { + node service/send-subscription.js send '$EMAIL' '$SUB_URL'" || { echo "" echo "⚠️ 邮件发送失败,请手动将以下订阅链接发送给用户:" echo " $SUB_URL" diff --git a/server/proxy/service/send-subscription.js b/server/proxy/service/send-subscription.js index c8cfd249..059e3e84 100644 --- a/server/proxy/service/send-subscription.js +++ b/server/proxy/service/send-subscription.js @@ -125,8 +125,8 @@ function detectSmtpHost(email) { } // ── 生成订阅邮件HTML ───────────────────────── -function generateSubscriptionEmail(config) { - const subUrl = `http://${config.server_host}/api/proxy-sub/sub/${config.sub_token}`; +function generateSubscriptionEmail(config, urlOverride) { + const subUrl = urlOverride || `http://${config.server_host}/api/proxy-sub/sub/${config.sub_token}`; const now = new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' }); return ` @@ -226,7 +226,7 @@ function generateAlertEmail(message) { // ── 主入口 ─────────────────────────────────── async function main() { - const [,, action, target] = process.argv; + const [,, action, target, urlOverride] = process.argv; if (!action) { console.log('用法:'); @@ -245,7 +245,7 @@ async function main() { } console.log(`📧 发送订阅链接到: ${email}`); - const html = generateSubscriptionEmail(config); + const html = generateSubscriptionEmail(config, urlOverride); try { await sendEmail(email, '🏛️ 铸渊专线 · 订阅链接', html);