From 5821154fb1ce56fdc5326c98f3acc777ec407980 Mon Sep 17 00:00:00 2001 From: zhx Date: Thu, 21 May 2026 12:07:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B8=B8=E6=88=8F=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/games/hooks/useGamesPage.js | 13 +++++--- src/features/games/pages/GameListPage.jsx | 37 +++++++++++++---------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/features/games/hooks/useGamesPage.js b/src/features/games/hooks/useGamesPage.js index 9d69f2f..6d3880d 100644 --- a/src/features/games/hooks/useGamesPage.js +++ b/src/features/games/hooks/useGamesPage.js @@ -312,19 +312,22 @@ function gamePayload(form) { } function platformPayload(form) { + const isLeaderCC = form.adapterType.trim() === "leadercc_v1"; return { platformCode: form.platformCode.trim(), platformName: form.platformName.trim(), status: form.status.trim() || "active", - apiBaseUrl: form.apiBaseUrl.trim(), + apiBaseUrl: isLeaderCC ? "" : form.apiBaseUrl.trim(), adapterType: form.adapterType.trim() || "demo", // 空密钥提交给后端后会保留旧值;非空才覆盖,用于安全轮换 key/AppSecret。 callbackSecret: form.callbackSecret.trim(), // 支持换行或逗号分隔,方便直接粘贴厂商给的多 IP 白名单。 - callbackIpWhitelist: form.callbackIpWhitelistText - .split(/[\n,]/) - .map((item) => item.trim()) - .filter(Boolean), + callbackIpWhitelist: isLeaderCC + ? [] + : form.callbackIpWhitelistText + .split(/[\n,]/) + .map((item) => item.trim()) + .filter(Boolean), // JSON 不在前端强解析,避免前端版本限制后端新增厂商字段。 adapterConfigJson: form.adapterConfigJson.trim() || "{}", sortOrder: Number(form.sortOrder || 0), diff --git a/src/features/games/pages/GameListPage.jsx b/src/features/games/pages/GameListPage.jsx index c251552..b9a5cd8 100644 --- a/src/features/games/pages/GameListPage.jsx +++ b/src/features/games/pages/GameListPage.jsx @@ -378,6 +378,7 @@ function GameFormDialog({ form, loading, mode, open, page, onClose, onSubmit }) } function PlatformFormDialog({ form, loading, mode, open, page, onClose, onSubmit }) { + const isLeaderCC = form.adapterType === "leadercc_v1"; return ( ))} - page.setPlatformForm({ ...form, apiBaseUrl: event.target.value })} - /> + {!isLeaderCC ? ( + page.setPlatformForm({ ...form, apiBaseUrl: event.target.value })} + /> + ) : null} {/* 密钥不回显;编辑平台时留空表示沿用旧密钥,输入新值才覆盖。 */} page.setPlatformForm({ ...form, callbackSecret: event.target.value })} /> - - page.setPlatformForm({ ...form, callbackIpWhitelistText: event.target.value }) - } - /> + {!isLeaderCC ? ( + + page.setPlatformForm({ ...form, callbackIpWhitelistText: event.target.value }) + } + /> + ) : null} {/* 厂商差异字段放 JSON:如 uid_mode、default_lang、token_ttl_seconds、game_level_uid。 */} {platform.platformCode} / {platform.adapterType || "demo"} - {platform.apiBaseUrl} + {platform.apiBaseUrl ? {platform.apiBaseUrl} : null}