diff --git a/.env.development b/.env.development index 8d5e823..507289b 100644 --- a/.env.development +++ b/.env.development @@ -1,8 +1,8 @@ -# NEXT_PUBLIC_JAVA_URL = https://77.app.java.auth.qikongjian.com -# NEXT_PUBLIC_BASE_URL = https://77.smartvideo.py.qikongjian.com -NEXT_PUBLIC_JAVA_URL = http://test.java.movieflow.ai -NEXT_PUBLIC_BASE_URL = http://test.video.movieflow.ai +NEXT_PUBLIC_JAVA_URL = https://77.app.java.auth.qikongjian.com +NEXT_PUBLIC_BASE_URL = https://77.smartvideo.py.qikongjian.com +# NEXT_PUBLIC_JAVA_URL = http://test.java.movieflow.ai +# NEXT_PUBLIC_BASE_URL = http://test.video.movieflow.ai # 失败率 NEXT_PUBLIC_ERROR_CONFIG = 0.2 \ No newline at end of file diff --git a/components/auth/auth-guard.tsx b/components/auth/auth-guard.tsx index 031197c..2699e6d 100644 --- a/components/auth/auth-guard.tsx +++ b/components/auth/auth-guard.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react'; import { useRouter, usePathname } from 'next/navigation'; -import { checkAuth, clearAuthData, getUserProfile, isAuthenticated } from '@/lib/auth'; +import { clearAuthData, getUserProfile, isAuthenticated } from '@/lib/auth'; import GlobalLoad from '../common/GlobalLoad'; import { message } from 'antd'; import { errorHandle } from '@/api/errorHandle'; diff --git a/lib/auth.ts b/lib/auth.ts index f6eb482..fb3de7c 100644 --- a/lib/auth.ts +++ b/lib/auth.ts @@ -41,40 +41,6 @@ export const loginUser = async (email: string, password: string) => { } }; -/** - * 鉴权检查 - */ -export const checkAuth = async (): Promise => { - const token = getToken(); - if (!token) { - return false; - } - - try { - const response = await fetch(`${process.env.NEXT_PUBLIC_API_BASE_URL}/admin/login/auth`, { - method: 'POST', - headers: { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - 'X-EASE-ADMIN-TOKEN': token, - }, - }); - - const data = await response.json(); - return true; - // if (data.code === '401' || data.status === 401) { - // // Token无效,清除本地存储 - // // clearAuthData(); - // // return false; - // } - - // return data.code === '200' && data.status === 200; - } catch (error) { - console.error('Auth check failed:', error); - return false; - } -}; - /** * 获取token */