fix: display backend error message directly without i18n translation
This commit is contained in:
@@ -1127,12 +1127,6 @@ func (h *AccountHandler) BulkUpdate(c *gin.Context) {
|
|||||||
c.JSON(409, gin.H{
|
c.JSON(409, gin.H{
|
||||||
"error": "mixed_channel_warning",
|
"error": "mixed_channel_warning",
|
||||||
"message": mixedErr.Error(),
|
"message": mixedErr.Error(),
|
||||||
"details": gin.H{
|
|
||||||
"group_id": mixedErr.GroupID,
|
|
||||||
"group_name": mixedErr.GroupName,
|
|
||||||
"current_platform": mixedErr.CurrentPlatform,
|
|
||||||
"other_platform": mixedErr.OtherPlatform,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1283,11 +1283,7 @@ const preCheckMixedChannelRisk = async (built: Record<string, unknown>): Promise
|
|||||||
if (!result.has_risk) return true
|
if (!result.has_risk) return true
|
||||||
|
|
||||||
pendingUpdatesForConfirm.value = built
|
pendingUpdatesForConfirm.value = built
|
||||||
mixedChannelWarningMessage.value = t('admin.accounts.mixedChannelWarning', {
|
mixedChannelWarningMessage.value = result.message || t('admin.accounts.bulkEdit.failed')
|
||||||
groupName: result.details?.group_name,
|
|
||||||
currentPlatform: result.details?.current_platform,
|
|
||||||
otherPlatform: result.details?.other_platform
|
|
||||||
})
|
|
||||||
showMixedChannelWarning.value = true
|
showMixedChannelWarning.value = true
|
||||||
return false
|
return false
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
@@ -1362,11 +1358,7 @@ const submitBulkUpdate = async (baseUpdates: Record<string, unknown>) => {
|
|||||||
// 兜底:多平台混合场景下,预检查跳过,由后端 409 触发确认框
|
// 兜底:多平台混合场景下,预检查跳过,由后端 409 触发确认框
|
||||||
if (error.status === 409 && error.error === 'mixed_channel_warning') {
|
if (error.status === 409 && error.error === 'mixed_channel_warning') {
|
||||||
pendingUpdatesForConfirm.value = baseUpdates
|
pendingUpdatesForConfirm.value = baseUpdates
|
||||||
mixedChannelWarningMessage.value = t('admin.accounts.mixedChannelWarning', {
|
mixedChannelWarningMessage.value = error.message
|
||||||
groupName: error.details?.group_name,
|
|
||||||
currentPlatform: error.details?.current_platform,
|
|
||||||
otherPlatform: error.details?.other_platform
|
|
||||||
})
|
|
||||||
showMixedChannelWarning.value = true
|
showMixedChannelWarning.value = true
|
||||||
} else {
|
} else {
|
||||||
appStore.showError(error.message || t('admin.accounts.bulkEdit.failed'))
|
appStore.showError(error.message || t('admin.accounts.bulkEdit.failed'))
|
||||||
|
|||||||
Reference in New Issue
Block a user