mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 21:17:30 +00:00
feat: 增强 API Key 标签选择功能
- 添加获取已存在标签的 API 端点 /admin/api-keys/tags - 重构标签输入 UI,从下拉菜单改为平铺展示 - 支持点击选择已有标签,避免重复创建 - 增加弹框宽度 (max-w-4xl),改善布局和用户体验 - 统一创建和编辑 API Key 的标签管理体验 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -159,6 +159,21 @@ export const useApiKeysStore = defineStore('apiKeys', () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取已存在的标签
|
||||
const fetchTags = async () => {
|
||||
try {
|
||||
const response = await apiClient.get('/admin/api-keys/tags')
|
||||
if (response.success) {
|
||||
return response.data || []
|
||||
} else {
|
||||
throw new Error(response.message || '获取标签失败')
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('获取标签失败:', err)
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
// 重置store
|
||||
const reset = () => {
|
||||
apiKeys.value = []
|
||||
@@ -186,6 +201,7 @@ export const useApiKeysStore = defineStore('apiKeys', () => {
|
||||
renewApiKey,
|
||||
deleteApiKey,
|
||||
fetchApiKeyStats,
|
||||
fetchTags,
|
||||
sortApiKeys,
|
||||
reset
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user