修改游戏配置
This commit is contained in:
parent
841480d89e
commit
5821154fb1
@ -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),
|
||||
|
||||
@ -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 (
|
||||
<AdminFormDialog
|
||||
disabled={!page.abilities.canUpdate}
|
||||
@ -439,12 +440,14 @@ function PlatformFormDialog({ form, loading, mode, open, page, onClose, onSubmit
|
||||
</MenuItem>
|
||||
))}
|
||||
</TextField>
|
||||
<TextField
|
||||
label="H5/Auth URL"
|
||||
required
|
||||
value={form.apiBaseUrl}
|
||||
onChange={(event) => page.setPlatformForm({ ...form, apiBaseUrl: event.target.value })}
|
||||
/>
|
||||
{!isLeaderCC ? (
|
||||
<TextField
|
||||
label="H5/Auth URL"
|
||||
required={form.adapterType === "yomi_v4"}
|
||||
value={form.apiBaseUrl}
|
||||
onChange={(event) => page.setPlatformForm({ ...form, apiBaseUrl: event.target.value })}
|
||||
/>
|
||||
) : null}
|
||||
{/* 密钥不回显;编辑平台时留空表示沿用旧密钥,输入新值才覆盖。 */}
|
||||
<TextField
|
||||
label={form.callbackSecretSet ? "回调密钥(已配置)" : "回调密钥"}
|
||||
@ -452,15 +455,17 @@ function PlatformFormDialog({ form, loading, mode, open, page, onClose, onSubmit
|
||||
value={form.callbackSecret}
|
||||
onChange={(event) => page.setPlatformForm({ ...form, callbackSecret: event.target.value })}
|
||||
/>
|
||||
<TextField
|
||||
label="IP 白名单"
|
||||
minRows={3}
|
||||
multiline
|
||||
value={form.callbackIpWhitelistText}
|
||||
onChange={(event) =>
|
||||
page.setPlatformForm({ ...form, callbackIpWhitelistText: event.target.value })
|
||||
}
|
||||
/>
|
||||
{!isLeaderCC ? (
|
||||
<TextField
|
||||
label="IP 白名单"
|
||||
minRows={3}
|
||||
multiline
|
||||
value={form.callbackIpWhitelistText}
|
||||
onChange={(event) =>
|
||||
page.setPlatformForm({ ...form, callbackIpWhitelistText: event.target.value })
|
||||
}
|
||||
/>
|
||||
) : null}
|
||||
{/* 厂商差异字段放 JSON:如 uid_mode、default_lang、token_ttl_seconds、game_level_uid。 */}
|
||||
<TextField
|
||||
className={styles.fullField}
|
||||
@ -499,7 +504,7 @@ function PlatformManageDialog({ open, page, onClose }) {
|
||||
<span className={styles.meta}>
|
||||
{platform.platformCode} / {platform.adapterType || "demo"}
|
||||
</span>
|
||||
<span className={styles.meta}>{platform.apiBaseUrl}</span>
|
||||
{platform.apiBaseUrl ? <span className={styles.meta}>{platform.apiBaseUrl}</span> : null}
|
||||
</div>
|
||||
<div className={styles.platformActions}>
|
||||
<span className={styles.meta}>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user