fix(admin): 修复零值字段无法保存的问题

- 用户允许分组:前端发送空数组而非 null 表示"允许全部"
- 账户代理:前端发送 0 而非 null 表示"无代理"
- 后端 UpdateAccount/BulkUpdate 正确处理 ProxyID=0 为清除代理
This commit is contained in:
shaw
2026-01-05 20:53:38 +08:00
parent c27d511736
commit 4d078a8854
4 changed files with 20 additions and 9 deletions

View File

@@ -52,7 +52,7 @@ const load = async () => { loading.value = true; try { const res = await adminAP
const handleSave = async () => {
if (!props.user) return; submitting.value = true
try {
await adminAPI.users.update(props.user.id, { allowed_groups: selectedIds.value.length > 0 ? selectedIds.value : null })
await adminAPI.users.update(props.user.id, { allowed_groups: selectedIds.value })
appStore.showSuccess(t('admin.users.allowedGroupsUpdated')); emit('success'); emit('close')
} catch {} finally { submitting.value = false }
}