Merge pull request #130 from guanweiwang/main

fix: auth 登录问题
This commit is contained in:
Yoko
2025-07-23 15:20:18 +08:00
committed by GitHub
3 changed files with 5 additions and 4 deletions

View File

@@ -38,7 +38,7 @@ export enum ContentType {
}
const whitePathnameList = ['/user/login', '/login'];
const whitePathnameList = ['/user/login', '/login', '/auth'];
const whiteApiList = ['/api/v1/user/profile', '/api/v1/admin/profile'];
const redirectToLogin = () => {

View File

@@ -58,7 +58,7 @@ export enum ContentType {
Text = "text/plain",
}
const whitePathnameList = ["/user/login", "/login"];
const whitePathnameList = ["/user/login", "/login", "/auth"];
const whiteApiList = ["/api/v1/user/profile", "/api/v1/admin/profile"];
const redirectToLogin = () => {

View File

@@ -45,10 +45,9 @@ const App = () => {
.finally(() => {
setLoading(false);
});
} else {
} else if (!location.pathname.startsWith('/auth')) {
return getAdminProfile()
.then((res) => {
console.log(res);
setUser(res);
if (location.pathname.startsWith('/login')) {
onGotoRedirect('admin');
@@ -57,6 +56,8 @@ const App = () => {
.finally(() => {
setLoading(false);
});
} else {
setLoading(false);
}
};