feat(seller): 微信区上号方式与账号密码互斥,自动固定为扫码

This commit is contained in:
yml2213
2026-08-15 10:47:06 +08:00
parent fbd59ed19f
commit aef36dc4f5
3 changed files with 41 additions and 6 deletions
@@ -89,6 +89,29 @@ export function usePublishForm(options: UsePublishFormOptions) {
screenshotFiles,
selectedSkins,
})
// ========== 上号方式互斥 ==========
// 微信区账号只能扫码登录:选择微信区后,「账号密码」不可选,默认固定为「扫码」。
const scanOnlyServers = ['微信']
const scanLoginMethod = '扫码'
const passwordLoginMethod = '账号密码'
const isScanOnlyServer = computed(() => scanOnlyServers.includes(form.server_region))
const effectiveLoginMethodOptions = computed(() => {
if (!isScanOnlyServer.value) return pricing.loginMethodOptions.value
return pricing.loginMethodOptions.value.filter(option => option !== passwordLoginMethod)
})
watch(
() => form.server_region,
server => {
if (!scanOnlyServers.includes(server)) return
if (form.login_method !== scanLoginMethod) {
form.login_method = scanLoginMethod
}
}
)
const uploadedScreenshotCount = computed(
() => pricing.screenshotSlots.value.filter(item => getScreenshotCount(item.key) > 0).length
)
@@ -885,6 +908,8 @@ export function usePublishForm(options: UsePublishFormOptions) {
passwordAndDeviceConfirmed,
canPublishAfterAgreements,
showBanRecordRiskHint,
isScanOnlyServer,
effectiveLoginMethodOptions,
fileInput,
activeUploadKey,
form,