rkljw 4 өдөр өмнө
parent
commit
d441560108
1 өөрчлөгдсөн 8 нэмэгдсэн , 5 устгасан
  1. 8 5
      src/permission.js

+ 8 - 5
src/permission.js

@@ -82,10 +82,7 @@ router.beforeEach(async(to, from, next) => {
     }
   } else {
     /* has no token*/
-    const userurl = hashParams();
-    if(userurl){
-      setUserUrl(userurl, 86400) 
-    }
+   
     if (whiteList.indexOf(to.path) !== -1) {
       // in the free login whitelist, go directly
       next()
@@ -93,7 +90,13 @@ router.beforeEach(async(to, from, next) => {
       // other pages that do not have permission to access are redirected to the login page.
       next(`/login?redirect=${to.path}`)
       NProgress.done()
-      setUserUrl(URL.webUrl, 86400)
+      const userurl = hashParams();
+      if(userurl){
+        setUserUrl(userurl, 86400) 
+      }else{
+        setUserUrl(URL.webUrl, 86400)
+      }
+      
     }
   }
 })