From 7dfc81a6d80812f11cbfdc8467401c0dfb74534c Mon Sep 17 00:00:00 2001
From: ForgQi <34411314+ForgQi@users.noreply.github.com>
Date: Thu, 18 Sep 2025 00:13:13 +0800
Subject: [PATCH] =?UTF-8?q?Revert=20"=E4=BC=98=E5=8C=96=E7=99=BB=E5=BD=95?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD`=20(#1386)"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This reverts commit 795f2965ccc05efc42c733a0bbbfea589e3098f7.
---
app/lib/auth-context.tsx | 3 +--
app/lib/auth-guard.tsx | 3 +--
app/lib/protected-layout.tsx | 12 ------------
app/login/page.tsx | 6 +-----
4 files changed, 3 insertions(+), 21 deletions(-)
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)',
}}>