From ae8dba99b7543602e0a78d6acc1e78b2ad1420f8 Mon Sep 17 00:00:00 2001 From: JianMiau Date: Thu, 20 Aug 2026 11:32:41 +0800 Subject: [PATCH] =?UTF-8?q?V2=20=E6=8E=A8=E9=80=81=20LINE=20=E6=94=B9?= =?UTF-8?q?=E4=BE=9D=E7=92=B0=E5=A2=83=E6=B1=BA=E5=AE=9A=E7=9B=AE=E6=A8=99?= =?UTF-8?q?=EF=BC=8C=E7=A7=BB=E9=99=A4=E5=8D=A1=E7=89=87=E5=BA=95=E9=83=A8?= =?UTF-8?q?=E8=AA=AA=E6=98=8E=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根本原因: V2 原本把推送目標寫死在測試對話(target: local),部署到 NAS 後也只會 私訊測試對象,無法推到正式羽球群;另外卡片底部的「搭檔不重複・實力平衡 排點」說明文字對群組成員沒有意義。 影響: - NAS 正式環境(LINE_TARGET_MODE=prod)推送到勝皇羽球團群組 - 本機開發(local)維持推到測試對話,按鈕會標示「推送到 LINE(測試)」 - LINE 卡片不再顯示底部說明文字 修法: 前端移除寫死的 target 參數,交由 server 依 LINE_TARGET_MODE 解析目標; 按鈕文字與推送成功訊息改為依環境顯示;buildLineFlexMessageV2 移除 footer。 Co-Authored-By: Claude Fable 5 --- README.md | 2 +- server/server.mjs | 14 -------------- src/AppV2.tsx | 5 ++--- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index d9f9799..e02beb3 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ - 人數 4~7 人時只排 2 號場地 8 局;未滿 4 人無法排賽程 - `讀取指定日期` 可把之前上傳的 V2 賽程從資料庫回填到畫面;該日還沒賽程時會自動改載入出席名單(V1 格式的舊資料請到 `/v1` 讀取) - 上傳沿用原本的 `badminton` 表:`personnel` 存全部出席者、`battlecombination` 的 `"0"` / `"1"` 分別存 2、3 號場地的 16 組搭檔(依序每 2 組為一局的對戰雙方) -- `推送到 LINE` 固定推到測試群組(`LINE_TARGET_ID_LOCAL`),不會推到正式羽球群;一樣要按兩次確認 +- `推送到 LINE` 跟著 `LINE_TARGET_MODE` 走:NAS 正式環境(`prod`)推到羽球群、本機開發(`local`)推到測試對話;一樣要按兩次確認,`local` 模式時按鈕會標示「測試」 ## V1 功能說明(`/v1`) diff --git a/server/server.mjs b/server/server.mjs index 31ce6a6..524ac20 100644 --- a/server/server.mjs +++ b/server/server.mjs @@ -499,20 +499,6 @@ function buildLineFlexMessageV2(time, courts) { ], })), }, - footer: { - type: 'box', - layout: 'vertical', - paddingAll: '10px', - contents: [ - { - type: 'text', - text: '搭檔不重複・實力平衡排點', - size: 'xxs', - color: '#9AA89E', - align: 'center', - }, - ], - }, })), }, } diff --git a/src/AppV2.tsx b/src/AppV2.tsx index e656690..d3d2b4d 100644 --- a/src/AppV2.tsx +++ b/src/AppV2.tsx @@ -322,7 +322,7 @@ function AppV2() { await pushScheduleToLine(timeKey, schedule) setActionState('sharing') - setActionMessage(`已推送到 LINE 測試群組:${timeKey}`) + setActionMessage(`已推送到 LINE:${timeKey}`) } catch (pushError) { setActionState('error') setActionMessage( @@ -441,7 +441,7 @@ function AppV2() { onClick={() => void pushToLine()} disabled={actionState === 'saving' || actionState === 'loading'} > - {linePushArmed ? '確認推送到 LINE' : '推送到 LINE(測試群)'} + {linePushArmed ? '確認推送到 LINE' : showTestBadge ? '推送到 LINE(測試)' : '推送到 LINE'} ) : null} @@ -803,7 +803,6 @@ async function pushScheduleToLine(time: string, schedule: ScheduleRound[]) { }, body: JSON.stringify({ time, - target: 'local', courts: courtGames.map(([court, games]) => ({ court, games: games.map((game, gameIndex) => ({