fix(accounts): 账号管理改为单行增量更新并避免全量刷新

- 将编辑与重新授权成功事件改为回传更新后的账号对象
- 在账号列表页按 id 就地补丁更新单行数据并保留运行时容量字段
- 单账号操作(刷新凭证/清错/清限流/临时不可调度重置)改为单行更新
- 后端增强 clear-rate-limit 接口,返回更新后的账号对象
- 同步前端 clearRateLimit API 类型定义

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
yangjianbo
2026-02-14 12:06:17 +08:00
parent f6bff97d26
commit 9cafa46dd3
5 changed files with 112 additions and 26 deletions

View File

@@ -1111,7 +1111,7 @@ interface Props {
const props = defineProps<Props>()
const emit = defineEmits<{
close: []
updated: []
updated: [account: Account]
}>()
const { t } = useI18n()
@@ -1849,9 +1849,9 @@ const handleSubmit = async () => {
updatePayload.extra = newExtra
}
await adminAPI.accounts.update(props.account.id, updatePayload)
const updatedAccount = await adminAPI.accounts.update(props.account.id, updatePayload)
appStore.showSuccess(t('admin.accounts.accountUpdated'))
emit('updated')
emit('updated', updatedAccount)
handleClose()
} catch (error: any) {
// Handle 409 mixed_channel_warning - show confirmation dialog
@@ -1879,9 +1879,9 @@ const handleMixedChannelConfirm = async () => {
pendingUpdatePayload.value.confirm_mixed_channel_risk = true
submitting.value = true
try {
await adminAPI.accounts.update(props.account.id, pendingUpdatePayload.value)
const updatedAccount = await adminAPI.accounts.update(props.account.id, pendingUpdatePayload.value)
appStore.showSuccess(t('admin.accounts.accountUpdated'))
emit('updated')
emit('updated', updatedAccount)
handleClose()
} catch (error: any) {
appStore.showError(error.response?.data?.message || error.response?.data?.detail || t('admin.accounts.failedToUpdate'))