mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-22 16:43:35 +00:00
fix: 解决Git合并冲突
- 解决ApiKeysView.vue中的合并冲突 - 解决CreateApiKeyModal.vue中的合并冲突 - 解决EditApiKeyModal.vue中的合并冲突 - 保留本地修改版本,包含更完善的功能: - Claude OAuth和Console账户分组显示 - 移动端响应式优化 - 批量创建API Key功能 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -433,15 +433,6 @@
|
|||||||
<option value="">
|
<option value="">
|
||||||
使用共享账号池
|
使用共享账号池
|
||||||
</option>
|
</option>
|
||||||
<<<<<<< Updated upstream
|
|
||||||
<option
|
|
||||||
v-for="account in accounts.claude.filter(a => a.isDedicated)"
|
|
||||||
:key="account.id"
|
|
||||||
:value="account.id"
|
|
||||||
>
|
|
||||||
{{ account.name }} ({{ account.status === 'active' ? '正常' : '异常' }})
|
|
||||||
</option>
|
|
||||||
=======
|
|
||||||
<optgroup
|
<optgroup
|
||||||
v-if="localAccounts.claude.filter(a => a.isDedicated && a.platform === 'claude-oauth').length > 0"
|
v-if="localAccounts.claude.filter(a => a.isDedicated && a.platform === 'claude-oauth').length > 0"
|
||||||
label="Claude OAuth 账号"
|
label="Claude OAuth 账号"
|
||||||
@@ -466,7 +457,6 @@
|
|||||||
{{ account.name }} ({{ account.status === 'active' ? '正常' : '异常' }})
|
{{ account.name }} ({{ account.status === 'active' ? '正常' : '异常' }})
|
||||||
</option>
|
</option>
|
||||||
</optgroup>
|
</optgroup>
|
||||||
>>>>>>> Stashed changes
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@@ -891,43 +881,6 @@ const createApiKey = async () => {
|
|||||||
dailyCostLimit: form.dailyCostLimit !== '' && form.dailyCostLimit !== null ? parseFloat(form.dailyCostLimit) : 0,
|
dailyCostLimit: form.dailyCostLimit !== '' && form.dailyCostLimit !== null ? parseFloat(form.dailyCostLimit) : 0,
|
||||||
expiresAt: form.expiresAt || undefined,
|
expiresAt: form.expiresAt || undefined,
|
||||||
permissions: form.permissions,
|
permissions: form.permissions,
|
||||||
<<<<<<< Updated upstream
|
|
||||||
claudeAccountId: form.claudeAccountId || undefined,
|
|
||||||
geminiAccountId: form.geminiAccountId || undefined,
|
|
||||||
tags: form.tags.length > 0 ? form.tags : undefined
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理Claude账户绑定(区分OAuth和Console)
|
|
||||||
if (form.claudeAccountId) {
|
|
||||||
if (form.claudeAccountId.startsWith('console:')) {
|
|
||||||
// Claude Console账户
|
|
||||||
data.claudeConsoleAccountId = form.claudeAccountId.substring(8);
|
|
||||||
} else {
|
|
||||||
// Claude OAuth账户
|
|
||||||
data.claudeAccountId = form.claudeAccountId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gemini账户绑定
|
|
||||||
if (form.geminiAccountId) {
|
|
||||||
data.geminiAccountId = form.geminiAccountId;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 模型限制 - 始终提交这些字段
|
|
||||||
data.enableModelRestriction = form.enableModelRestriction
|
|
||||||
data.restrictedModels = form.restrictedModels
|
|
||||||
|
|
||||||
// 客户端限制 - 始终提交这些字段
|
|
||||||
data.enableClientRestriction = form.enableClientRestriction
|
|
||||||
data.allowedClients = form.allowedClients
|
|
||||||
|
|
||||||
const result = await apiClient.post('/admin/api-keys', data)
|
|
||||||
|
|
||||||
if (result.success) {
|
|
||||||
showToast('API Key 创建成功', 'success')
|
|
||||||
emit('success', result.data)
|
|
||||||
emit('close')
|
|
||||||
=======
|
|
||||||
tags: form.tags.length > 0 ? form.tags : undefined,
|
tags: form.tags.length > 0 ? form.tags : undefined,
|
||||||
enableModelRestriction: form.enableModelRestriction,
|
enableModelRestriction: form.enableModelRestriction,
|
||||||
restrictedModels: form.restrictedModels,
|
restrictedModels: form.restrictedModels,
|
||||||
@@ -967,7 +920,6 @@ const createApiKey = async () => {
|
|||||||
} else {
|
} else {
|
||||||
showToast(result.message || '创建失败', 'error')
|
showToast(result.message || '创建失败', 'error')
|
||||||
}
|
}
|
||||||
>>>>>>> Stashed changes
|
|
||||||
} else {
|
} else {
|
||||||
// 批量创建
|
// 批量创建
|
||||||
const data = {
|
const data = {
|
||||||
|
|||||||
@@ -302,15 +302,6 @@
|
|||||||
<option value="">
|
<option value="">
|
||||||
使用共享账号池
|
使用共享账号池
|
||||||
</option>
|
</option>
|
||||||
<<<<<<< Updated upstream
|
|
||||||
<option
|
|
||||||
v-for="account in accounts.claude"
|
|
||||||
:key="account.id"
|
|
||||||
:value="account.id"
|
|
||||||
>
|
|
||||||
{{ account.name }} ({{ account.status === 'active' ? '正常' : '异常' }})
|
|
||||||
</option>
|
|
||||||
=======
|
|
||||||
<optgroup
|
<optgroup
|
||||||
v-if="localAccounts.claude.filter(a => a.isDedicated && a.platform === 'claude-oauth').length > 0"
|
v-if="localAccounts.claude.filter(a => a.isDedicated && a.platform === 'claude-oauth').length > 0"
|
||||||
label="Claude OAuth 账号"
|
label="Claude OAuth 账号"
|
||||||
@@ -335,7 +326,6 @@
|
|||||||
{{ account.name }} ({{ account.status === 'active' ? '正常' : '异常' }})
|
{{ account.name }} ({{ account.status === 'active' ? '正常' : '异常' }})
|
||||||
</option>
|
</option>
|
||||||
</optgroup>
|
</optgroup>
|
||||||
>>>>>>> Stashed changes
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -12,45 +12,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col sm:flex-row gap-3 sm:items-center sm:justify-between">
|
<div class="flex flex-col sm:flex-row gap-3 sm:items-center sm:justify-between">
|
||||||
<!-- Token统计时间范围选择 -->
|
<!-- Token统计时间范围选择 -->
|
||||||
<<<<<<< Updated upstream
|
|
||||||
<select
|
|
||||||
v-model="apiKeyStatsTimeRange"
|
|
||||||
class="px-2 py-1 text-sm text-gray-700 bg-white border border-gray-200 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent hover:border-gray-300 transition-colors"
|
|
||||||
@change="loadApiKeys()"
|
|
||||||
>
|
|
||||||
<option value="today">
|
|
||||||
今日
|
|
||||||
</option>
|
|
||||||
<option value="7days">
|
|
||||||
最近7天
|
|
||||||
</option>
|
|
||||||
<option value="monthly">
|
|
||||||
本月
|
|
||||||
</option>
|
|
||||||
<option value="all">
|
|
||||||
全部时间
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
<!-- 标签筛选器 -->
|
|
||||||
<select
|
|
||||||
v-model="selectedTagFilter"
|
|
||||||
class="px-2 py-1 text-sm text-gray-700 bg-white border border-gray-200 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent hover:border-gray-300 transition-colors"
|
|
||||||
@change="currentPage = 1"
|
|
||||||
>
|
|
||||||
<option value="">
|
|
||||||
所有标签
|
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
v-for="tag in availableTags"
|
|
||||||
:key="tag"
|
|
||||||
:value="tag"
|
|
||||||
=======
|
|
||||||
<div class="flex flex-wrap gap-2 items-center">
|
<div class="flex flex-wrap gap-2 items-center">
|
||||||
<select
|
<select
|
||||||
v-model="apiKeyStatsTimeRange"
|
v-model="apiKeyStatsTimeRange"
|
||||||
class="px-3 py-2 text-sm text-gray-700 bg-white border border-gray-200 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent hover:border-gray-300 transition-colors"
|
class="px-3 py-2 text-sm text-gray-700 bg-white border border-gray-200 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent hover:border-gray-300 transition-colors"
|
||||||
@change="loadApiKeys()"
|
@change="loadApiKeys()"
|
||||||
>>>>>>> Stashed changes
|
|
||||||
>
|
>
|
||||||
<option value="today">
|
<option value="today">
|
||||||
今日
|
今日
|
||||||
@@ -84,11 +50,7 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
<<<<<<< Updated upstream
|
|
||||||
class="btn btn-primary px-6 py-3 flex items-center gap-2"
|
|
||||||
=======
|
|
||||||
class="btn btn-primary px-4 py-2 text-sm flex items-center gap-2 w-full sm:w-auto justify-center"
|
class="btn btn-primary px-4 py-2 text-sm flex items-center gap-2 w-full sm:w-auto justify-center"
|
||||||
>>>>>>> Stashed changes
|
|
||||||
@click.stop="openCreateApiKeyModal"
|
@click.stop="openCreateApiKeyModal"
|
||||||
>
|
>
|
||||||
<i class="fas fa-plus" />创建新 Key
|
<i class="fas fa-plus" />创建新 Key
|
||||||
@@ -646,8 +608,6 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<<<<<<< Updated upstream
|
|
||||||
=======
|
|
||||||
|
|
||||||
<!-- 移动端卡片视图 -->
|
<!-- 移动端卡片视图 -->
|
||||||
<div
|
<div
|
||||||
@@ -946,7 +906,6 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
>>>>>>> Stashed changes
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 模态框组件 -->
|
<!-- 模态框组件 -->
|
||||||
|
|||||||
Reference in New Issue
Block a user