File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export enum ContentType {
3838}
3939
4040
41- const whitePathnameList = ['/user/login', '/login'];
41+ const whitePathnameList = ['/user/login', '/login', '/auth' ];
4242const whiteApiList = ['/api/v1/user/profile', '/api/v1/admin/profile'];
4343
4444const redirectToLogin = () => {
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ export enum ContentType {
5858 Text = "text/plain" ,
5959}
6060
61- const whitePathnameList = [ "/user/login" , "/login" ] ;
61+ const whitePathnameList = [ "/user/login" , "/login" , "/auth" ] ;
6262const whiteApiList = [ "/api/v1/user/profile" , "/api/v1/admin/profile" ] ;
6363
6464const redirectToLogin = ( ) => {
Original file line number Diff line number Diff line change @@ -45,10 +45,9 @@ const App = () => {
4545 . finally ( ( ) => {
4646 setLoading ( false ) ;
4747 } ) ;
48- } else {
48+ } else if ( ! location . pathname . startsWith ( '/auth' ) ) {
4949 return getAdminProfile ( )
5050 . then ( ( res ) => {
51- console . log ( res ) ;
5251 setUser ( res ) ;
5352 if ( location . pathname . startsWith ( '/login' ) ) {
5453 onGotoRedirect ( 'admin' ) ;
@@ -57,6 +56,8 @@ const App = () => {
5756 . finally ( ( ) => {
5857 setLoading ( false ) ;
5958 } ) ;
59+ } else {
60+ setLoading ( false ) ;
6061 }
6162 } ;
6263
You can’t perform that action at this time.
0 commit comments