feat: 完全移除 API Key 图标功能

彻底删除 API Key 图标功能的所有相关代码:

前端改动:
- 删除 IconPicker.vue 组件文件
- 移除 ApiKeysView.vue 中的图标显示和 updateApiKeyIcon 方法
- 清理 CreateApiKeyModal.vue 中的图标选择器
- 清理 EditApiKeyModal.vue 中的图标选择器
- 移除所有 IconPicker 组件的引用

后端改动:
- 从 apiKeyService.js 中移除 icon 字段更新支持
- 从 admin.js 路由中移除 icon 参数处理和验证逻辑
- 清理创建和更新 API Key 时的 icon 参数

此改动简化了 API Key 管理界面,移除了不必要的图标功能。

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Edric Li
2025-09-08 15:49:25 +08:00
parent b46ccb10d0
commit 3aa7c89e25
6 changed files with 7 additions and 1100 deletions

View File

@@ -1046,12 +1046,6 @@
:value="key.id"
@change="updateSelectAllState"
/>
<!-- API Key 图标 -->
<IconPicker
v-model="key.icon"
size="medium"
@update:model-value="(val) => updateApiKeyIcon(key.id, val)"
/>
<div>
<h4 class="text-sm font-semibold text-gray-900 dark:text-gray-100">
{{ key.name }}
@@ -1758,7 +1752,6 @@ import { apiClient } from '@/config/api'
import { useClientsStore } from '@/stores/clients'
import { useAuthStore } from '@/stores/auth'
import * as XLSX from 'xlsx-js-style'
import IconPicker from '@/components/common/IconPicker.vue'
import CreateApiKeyModal from '@/components/apikeys/CreateApiKeyModal.vue'
import EditApiKeyModal from '@/components/apikeys/EditApiKeyModal.vue'
import RenewApiKeyModal from '@/components/apikeys/RenewApiKeyModal.vue'
@@ -2977,28 +2970,6 @@ const toggleApiKeyStatus = async (key) => {
}
// 更新API Key图标
const updateApiKeyIcon = async (keyId, icon) => {
try {
const data = await apiClient.put(`/admin/api-keys/${keyId}`, {
icon: icon
})
if (data.success) {
// 更新本地数据
const localKey = apiKeys.value.find((k) => k.id === keyId)
if (localKey) {
localKey.icon = icon
}
showToast('图标已更新', 'success')
} else {
showToast(data.message || '更新图标失败', 'error')
}
} catch (error) {
console.error('更新图标失败:', error)
showToast('更新图标失败,请重试', 'error')
}
}
// 删除API Key
const deleteApiKey = async (keyId) => {
let confirmed = false