From 307dd031ebcd7f6eb23a25ca05b55ae74a4c9995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=B4=BA?= Date: Sat, 6 Sep 2025 19:59:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=A4=9A=E4=BD=99=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.tsx | 2 +- frontend/src/components/ApiKeyCard.tsx | 4 ++-- frontend/src/components/Stats.tsx | 7 +++---- src/services/apiKeyService.ts | 6 +++--- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index e2cf001..0574b03 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from 'react'; +import { useState, useEffect } from 'react'; import { AlertCircle, RefreshCw } from 'lucide-react'; import { ApiKeyForm } from './components/ApiKeyForm'; import { ApiKeyCard } from './components/ApiKeyCard'; diff --git a/frontend/src/components/ApiKeyCard.tsx b/frontend/src/components/ApiKeyCard.tsx index 75d3b0a..2a9e056 100644 --- a/frontend/src/components/ApiKeyCard.tsx +++ b/frontend/src/components/ApiKeyCard.tsx @@ -1,5 +1,5 @@ -import React, { useState } from 'react'; -import { CheckCircle2, XCircle, Loader2, Trash2, RefreshCw, Copy, Eye, EyeOff } from 'lucide-react'; +import { useState } from 'react'; +import { CheckCircle2, XCircle,Trash2, RefreshCw, Copy, Eye, EyeOff } from 'lucide-react'; import { apiKeyService } from '../services/api'; import type { ApiKey } from '../types/api'; diff --git a/frontend/src/components/Stats.tsx b/frontend/src/components/Stats.tsx index 62e631c..9318b02 100644 --- a/frontend/src/components/Stats.tsx +++ b/frontend/src/components/Stats.tsx @@ -1,5 +1,4 @@ -import React from 'react'; -import { CheckCircle, XCircle, DollarSign, Zap } from 'lucide-react'; +import { CheckCircle, XCircle, Zap,JapaneseYen } from 'lucide-react'; import type { ApiKey } from '../types/api'; interface StatsProps { @@ -36,8 +35,8 @@ export function Stats({ apiKeys }: StatsProps) { }, { name: '总余额', - value: `$${totalBalance.toFixed(2)}`, - icon: DollarSign, + value: `¥${totalBalance.toFixed(2)}`, + icon: JapaneseYen, color: 'text-blue-600', bgColor: 'bg-blue-50', }, diff --git a/src/services/apiKeyService.ts b/src/services/apiKeyService.ts index 062d0a4..d135023 100644 --- a/src/services/apiKeyService.ts +++ b/src/services/apiKeyService.ts @@ -6,7 +6,7 @@ const prisma = new PrismaClient(); export interface ApiKeyInput { name: string; key: string; - description?: string; + description?: string| null; } export interface ApiKeyWithValidation extends ApiKeyInput { @@ -20,7 +20,7 @@ export interface ApiKeyWithValidation extends ApiKeyInput { } | null; lastChecked: Date; checkCount: number; - error?: string; + error?: string | undefined; } export class ApiKeyService { @@ -44,7 +44,7 @@ export class ApiKeyService { ...apiKey, key: apiKey.key, // 直接传输真实key - error: validation.error || undefined, + error: validation.error , user: validation.user || null, }; }