fix: 修复专属账号下拉框,仅显示dedicated类型账号

- 修改CreateApiKeyModal和EditApiKeyModal的过滤逻辑
- 专属账号下拉框只显示accountType='dedicated'的账号
- 移除accountType='group'的账号,这些账号通过分组调度
- 更新标签文字为'专属账号'以更准确描述
This commit is contained in:
shaw
2025-08-03 22:25:06 +08:00
parent 9c9afe1528
commit a5c7eeaf84
8 changed files with 497 additions and 35 deletions

View File

@@ -315,11 +315,11 @@
</option>
</optgroup>
<optgroup
v-if="localAccounts.claude.filter(a => a.isDedicated && a.platform === 'claude-oauth').length > 0"
label="Claude OAuth 账号"
v-if="localAccounts.claude.filter(a => a.accountType === 'dedicated' && a.platform === 'claude-oauth').length > 0"
label="Claude OAuth 专属账号"
>
<option
v-for="account in localAccounts.claude.filter(a => a.isDedicated && a.platform === 'claude-oauth')"
v-for="account in localAccounts.claude.filter(a => a.accountType === 'dedicated' && a.platform === 'claude-oauth')"
:key="account.id"
:value="account.id"
>
@@ -327,11 +327,11 @@
</option>
</optgroup>
<optgroup
v-if="localAccounts.claude.filter(a => a.isDedicated && a.platform === 'claude-console').length > 0"
label="Claude Console 账号"
v-if="localAccounts.claude.filter(a => a.accountType === 'dedicated' && a.platform === 'claude-console').length > 0"
label="Claude Console 专属账号"
>
<option
v-for="account in localAccounts.claude.filter(a => a.isDedicated && a.platform === 'claude-console')"
v-for="account in localAccounts.claude.filter(a => a.accountType === 'dedicated' && a.platform === 'claude-console')"
:key="account.id"
:value="`console:${account.id}`"
>
@@ -363,11 +363,11 @@
</option>
</optgroup>
<optgroup
v-if="localAccounts.gemini.filter(a => a.isDedicated).length > 0"
label="Gemini 账号"
v-if="localAccounts.gemini.filter(a => a.accountType === 'dedicated').length > 0"
label="Gemini 专属账号"
>
<option
v-for="account in localAccounts.gemini.filter(a => a.isDedicated)"
v-for="account in localAccounts.gemini.filter(a => a.accountType === 'dedicated')"
:key="account.id"
:value="account.id"
>
@@ -700,7 +700,7 @@ const refreshAccounts = async () => {
claudeAccounts.push({
...account,
platform: 'claude-oauth',
isDedicated: account.accountType === 'dedicated'
isDedicated: account.accountType === 'dedicated' // 保留以便向后兼容
})
})
}
@@ -710,7 +710,7 @@ const refreshAccounts = async () => {
claudeAccounts.push({
...account,
platform: 'claude-console',
isDedicated: account.accountType === 'dedicated'
isDedicated: account.accountType === 'dedicated' // 保留以便向后兼容
})
})
}