fix: V2订阅发送缺少send参数 + URL覆盖未生效

工作流调用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>
This commit is contained in:
copilot-swe-agent[bot] 2026-04-05 10:28:02 +00:00 committed by GitHub
parent 682f3c70a4
commit 3178c96b35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -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"

View File

@ -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);