mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-02-03 07:13:26 +08:00
@@ -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 = () => {
|
||||
|
||||
@@ -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 = () => {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user