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

+ 4 - 0
src/permission.js

@@ -71,7 +71,9 @@ router.beforeEach(async(to, from, next) => {
           // Call getInfo to fetch user information
           const userInfo = await getInfo();
           console.log("User Info:", userInfo);
+          console.log("33333333333")
         } catch (error) {
+          console.log("444444444444")
           // remove token and go to login page to re-login
           await store.dispatch('user/resetToken')
           Message.error(error || 'Has Error')
@@ -83,6 +85,7 @@ router.beforeEach(async(to, from, next) => {
   } else {
     /* has no token*/
     if (whiteList.indexOf(to.path) !== -1) {
+      console.log("####111111111111")
       const userurl = hashParams();
       if(userurl){
         setUserUrl(userurl, 86400) 
@@ -90,6 +93,7 @@ router.beforeEach(async(to, from, next) => {
       // in the free login whitelist, go directly
       next()
     } else {
+      console.log("####22222222222")
       // other pages that do not have permission to access are redirected to the login page.
       next(`/login?redirect=${to.path}`)
       NProgress.done()