Эх сурвалжийг харах

空路径不添加重定向参数

Alfyn 6 өдөр өмнө
parent
commit
20a4ba66bf
1 өөрчлөгдсөн 5 нэмэгдсэн , 1 устгасан
  1. 5 1
      src/permission.js

+ 5 - 1
src/permission.js

@@ -122,7 +122,11 @@ router.beforeEach(async (to, from, next) => {
       if (window.location.href.startsWith('http://localhost')) {
         next({ path: '/user/login' })
       } else {
-        window.location.href = `https://dev.autocde.com/login?redirect=${to.fullPath}`
+        if(to.fullPath !== '/'){
+          window.location.href = `https://dev.autocde.com/login?redirect=${to.fullPath}`
+        }else{
+          window.location.href = `https://dev.autocde.com/login`
+        }
       }
       NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
     }