mirror of
https://gitee.com/wanwujie/sub2api
synced 2026-04-24 08:34:45 +08:00
fix(ui): mixed channel confirm for upstream create
This commit is contained in:
@@ -2795,7 +2795,7 @@ const createAccountAndFinish = async (
|
|||||||
if (!applyTempUnschedConfig(credentials)) {
|
if (!applyTempUnschedConfig(credentials)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
await adminAPI.accounts.create({
|
const payload: any = {
|
||||||
name: form.name,
|
name: form.name,
|
||||||
notes: form.notes,
|
notes: form.notes,
|
||||||
platform,
|
platform,
|
||||||
@@ -2809,7 +2809,28 @@ const createAccountAndFinish = async (
|
|||||||
group_ids: form.group_ids,
|
group_ids: form.group_ids,
|
||||||
expires_at: form.expires_at,
|
expires_at: form.expires_at,
|
||||||
auto_pause_on_expired: autoPauseOnExpired.value
|
auto_pause_on_expired: autoPauseOnExpired.value
|
||||||
})
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await adminAPI.accounts.create(payload)
|
||||||
|
} catch (error: any) {
|
||||||
|
// Handle 409 mixed_channel_warning - show confirmation dialog
|
||||||
|
// Note: upstream Antigravity create path uses createAccountAndFinish directly, so mixed warning
|
||||||
|
// must be handled here as well (otherwise user only sees a generic "failed" toast).
|
||||||
|
if (error.response?.status === 409 && error.response?.data?.error === 'mixed_channel_warning') {
|
||||||
|
const details = error.response.data.details || {}
|
||||||
|
mixedChannelWarningDetails.value = {
|
||||||
|
groupName: details.group_name || 'Unknown',
|
||||||
|
currentPlatform: details.current_platform || 'Unknown',
|
||||||
|
otherPlatform: details.other_platform || 'Unknown'
|
||||||
|
}
|
||||||
|
pendingCreatePayload.value = payload
|
||||||
|
showMixedChannelWarning.value = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
|
||||||
appStore.showSuccess(t('admin.accounts.accountCreated'))
|
appStore.showSuccess(t('admin.accounts.accountCreated'))
|
||||||
emit('created')
|
emit('created')
|
||||||
handleClose()
|
handleClose()
|
||||||
|
|||||||
Reference in New Issue
Block a user