feat: 删除 getKeyDisplayName 前端统一使用 key.name 显示

This commit is contained in:
AAEE86
2026-02-09 03:02:36 +08:00
parent dc76721d2c
commit d2f2d7f92d

View File

@@ -233,7 +233,7 @@
</div> </div>
<div class="flex flex-col min-w-0"> <div class="flex flex-col min-w-0">
<div class="flex items-center gap-1.5"> <div class="flex items-center gap-1.5">
<span class="text-sm font-medium truncate">{{ getKeyDisplayName(key) }}</span> <span class="text-sm font-medium truncate">{{ key.name || '未命名密钥' }}</span>
<!-- OAuth 订阅类型标签 (Codex) --> <!-- OAuth 订阅类型标签 (Codex) -->
<Badge <Badge
v-if="key.oauth_plan_type" v-if="key.oauth_plan_type"
@@ -1482,18 +1482,6 @@ function formatKiroSubscription(title: string | undefined): string {
return title return title
} }
// 获取 Key 的显示名称Kiro 优先显示邮箱)
function getKeyDisplayName(key: EndpointAPIKey): string {
// Kiro 类型优先显示邮箱(从 upstream_metadata.kiro.email 获取)
if (provider.value?.provider_type === 'kiro') {
const kiroEmail = key.upstream_metadata?.kiro?.email
if (kiroEmail) {
return kiroEmail
}
}
return key.name || '未命名密钥'
}
function shouldAutoRefreshCodexQuota(): boolean { function shouldAutoRefreshCodexQuota(): boolean {
if (provider.value?.provider_type !== 'codex') return false if (provider.value?.provider_type !== 'codex') return false