删掉之前的鉴权

This commit is contained in:
北枳 2025-09-05 21:07:22 +08:00
parent 20762e806c
commit dc13ab03e3
3 changed files with 5 additions and 39 deletions

View File

@ -1,8 +1,8 @@
# NEXT_PUBLIC_JAVA_URL = https://77.app.java.auth.qikongjian.com NEXT_PUBLIC_JAVA_URL = https://77.app.java.auth.qikongjian.com
# NEXT_PUBLIC_BASE_URL = https://77.smartvideo.py.qikongjian.com NEXT_PUBLIC_BASE_URL = https://77.smartvideo.py.qikongjian.com
NEXT_PUBLIC_JAVA_URL = http://test.java.movieflow.ai # NEXT_PUBLIC_JAVA_URL = http://test.java.movieflow.ai
NEXT_PUBLIC_BASE_URL = http://test.video.movieflow.ai # NEXT_PUBLIC_BASE_URL = http://test.video.movieflow.ai
# 失败率 # 失败率
NEXT_PUBLIC_ERROR_CONFIG = 0.2 NEXT_PUBLIC_ERROR_CONFIG = 0.2

View File

@ -2,7 +2,7 @@
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { useRouter, usePathname } from 'next/navigation'; 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 GlobalLoad from '../common/GlobalLoad';
import { message } from 'antd'; import { message } from 'antd';
import { errorHandle } from '@/api/errorHandle'; import { errorHandle } from '@/api/errorHandle';

View File

@ -41,40 +41,6 @@ export const loginUser = async (email: string, password: string) => {
} }
}; };
/**
*
*/
export const checkAuth = async (): Promise<boolean> => {
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 * token
*/ */