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, }; }