|
@@ -100,24 +100,24 @@ const router = new Router({
|
|
|
router.beforeEach(async (to, from, next) => {
|
|
|
|
|
|
|
|
|
- let title = to.name ? to.name : '领存BMC'
|
|
|
- console.log("/login" == to.path)
|
|
|
- if("/login" == to.path) {
|
|
|
- next()
|
|
|
- return
|
|
|
- }
|
|
|
- let res = await api.Get('/action/checkLoginStatus',{})
|
|
|
- if(res.code == 200 && res.data.loginStatus == 'ok'){
|
|
|
- next()
|
|
|
- return
|
|
|
- }
|
|
|
- next({
|
|
|
- path:'/login',
|
|
|
- query:{
|
|
|
- redirect: to.path
|
|
|
- }
|
|
|
- })
|
|
|
- // next();
|
|
|
+ // let title = to.name ? to.name : '领存BMC'
|
|
|
+ // console.log("/login" == to.path)
|
|
|
+ // if("/login" == to.path) {
|
|
|
+ // next()
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // let res = await api.Get('/action/checkLoginStatus',{})
|
|
|
+ // if(res.code == 200 && res.data.loginStatus == 'ok'){
|
|
|
+ // next()
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // next({
|
|
|
+ // path:'/login',
|
|
|
+ // query:{
|
|
|
+ // redirect: to.path
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ next();
|
|
|
})
|
|
|
// // 跳转后返回顶部
|
|
|
// router.afterEach((to, from, next) => {
|