diff --git a/app/lib/auth-context.tsx b/app/lib/auth-context.tsx index 29fc605..6564f4f 100644 --- a/app/lib/auth-context.tsx +++ b/app/lib/auth-context.tsx @@ -39,10 +39,9 @@ export function AuthProvider({ children }: { children: ReactNode }) { const checkAuthRequired = async () => { try { - const auth = localStorage.getItem('auth'); const response = await fetch('/api/basic', { headers: { - 'Authorization': `Basic ${auth}` // 使用测试凭据 + 'Authorization': 'Basic dGVzdDp0ZXN0' // 使用测试凭据 } }); // 如果返回401,说明需要认证 diff --git a/app/lib/auth-guard.tsx b/app/lib/auth-guard.tsx index 5b38300..2a9cec8 100644 --- a/app/lib/auth-guard.tsx +++ b/app/lib/auth-guard.tsx @@ -14,10 +14,9 @@ export function AuthGuard({ children }: { children: React.ReactNode }) { // 如果用户未认证,则检查是否需要认证 if (!isAuthenticated) { // 检查是否需要认证 - const auth = localStorage.getItem('auth'); fetch('/api/basic', { headers: { - 'Authorization': `Basic ${auth}` // 使用测试凭据 + 'Authorization': 'Basic dGVzdDp0ZXN0' // 使用测试凭据 } }).then(response => { if (response.status !== 401) { diff --git a/app/lib/protected-layout.tsx b/app/lib/protected-layout.tsx index 5d6def9..2dcc41f 100644 --- a/app/lib/protected-layout.tsx +++ b/app/lib/protected-layout.tsx @@ -279,18 +279,6 @@ export default function ProtectedLayout({ children }: { children: React.ReactNod - {typeof window !== 'undefined' && localStorage.getItem('auth') && ( - - )} diff --git a/app/login/page.tsx b/app/login/page.tsx index 3f12a7d..e9b2e30 100644 --- a/app/login/page.tsx +++ b/app/login/page.tsx @@ -13,10 +13,9 @@ export default function LoginPage() { useEffect(() => { // 检查是否需要认证 - const auth = localStorage.getItem('auth'); fetch('/api/basic', { headers: { - 'Authorization': `Basic ${auth}` // 使用测试凭据 + 'Authorization': 'Basic dGVzdDp0ZXN0' // 使用测试凭据 } }).then(response => { if (response.status !== 401) { @@ -54,9 +53,6 @@ export default function LoginPage() { height: '100vh', background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)', backgroundSize: 'cover', - ['--semi-color-text-0' as any]: 'rgba(0, 0, 0, 1)', - ['--semi-color-text-1' as any]: 'rgba(0, 0, 0, 0.3)', - ['--semi-color-text-2' as any]: 'rgba(0, 0, 0, 0.3)', }}>