mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 09:38:02 +00:00
fix: 修复编辑账户时分组调度选择不生效的问题
- 为 Claude Console 和 Gemini 账户的更新接口添加分组处理逻辑 - 处理账户类型变更时的分组关系(从旧分组移除,添加到新分组) - 修复前端编辑账户时分组 ID 的初始化问题 - 优化删除账户时自动从分组中移除的逻辑 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1395,15 +1395,20 @@ watch(() => props.account, (newAccount) => {
|
||||
if (newAccount.accountType === 'group') {
|
||||
// 先加载分组列表
|
||||
loadGroups().then(() => {
|
||||
// 查找账户所属的分组
|
||||
groups.value.forEach(group => {
|
||||
apiClient.get(`/admin/account-groups/${group.id}/members`).then(response => {
|
||||
const members = response.data || []
|
||||
if (members.some(m => m.id === newAccount.id)) {
|
||||
form.value.groupId = group.id
|
||||
}
|
||||
}).catch(() => {})
|
||||
})
|
||||
// 如果账户有 groupInfo,直接使用它的 groupId
|
||||
if (newAccount.groupInfo && newAccount.groupInfo.id) {
|
||||
form.value.groupId = newAccount.groupInfo.id
|
||||
} else {
|
||||
// 否则查找账户所属的分组
|
||||
groups.value.forEach(group => {
|
||||
apiClient.get(`/admin/account-groups/${group.id}/members`).then(response => {
|
||||
const members = response.data || []
|
||||
if (members.some(m => m.id === newAccount.id)) {
|
||||
form.value.groupId = group.id
|
||||
}
|
||||
}).catch(() => {})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user