fix: close admin settings review gaps

This commit is contained in:
IanShaw027
2026-04-21 00:41:29 +08:00
parent 55e8dd550a
commit 030da8c2f6
8 changed files with 110 additions and 14 deletions

View File

@@ -2728,8 +2728,8 @@
<p class="mt-1.5 text-xs text-gray-400">
{{
localText(
'留空表示自动路由;仅允许当前系统支持的官方或易支付来源。',
'Leave blank for automatic routing. Only supported official or EasyPay sources are allowed.'
'启用后必须明确选择一个来源;未配置状态不会对外展示该支付方式。',
'Choose an explicit source before enabling the method. Not configured methods are not exposed.'
)
}}
</p>
@@ -3450,6 +3450,28 @@ function setPaymentVisibleMethodSource(
form.payment_visible_method_wxpay_source = normalized
}
function validatePaymentVisibleMethodSelections(): boolean {
for (const visibleMethod of paymentVisibleMethodCards.value) {
if (!getPaymentVisibleMethodEnabled(visibleMethod.key)) {
continue
}
if (getPaymentVisibleMethodSource(visibleMethod.key)) {
continue
}
appStore.showError(
localText(
`${visibleMethod.title} 已启用,请先选择支付来源`,
`Select a payment source before enabling ${visibleMethod.title}`
)
)
return false
}
return true
}
// Proxies for web search emulation ProxySelector
const webSearchProxies = ref<Proxy[]>([])
@@ -3979,6 +4001,10 @@ async function saveSettings() {
}
}
if (!validatePaymentVisibleMethodSelections()) {
return
}
// Validate URL fields — novalidate disables browser-native checks, so we validate here
const isValidHttpUrl = (url: string): boolean => {
if (!url) return true