zhaoxiaoqiang
2022-10-11 cb74707f3a8d61a884343c57e63f9cfdaf7434b1
src/router/index.js
@@ -2,7 +2,7 @@
 * @Author: 小明丶
 * @Date: 2019-08-19 15:23:17
 * @LastEditors: zxq
 * @LastEditTime: 2022-08-02 17:27:35
 * @LastEditTime: 2022-08-09 15:12:13
 * @Description:
 */
import Vue from "vue";
@@ -25,14 +25,14 @@
// 全局前置守卫:页面跳转前拦截
router.beforeEach((to, from, next) => {
    if(to.meta.isLogin){
        next()
    }else{
        // 需要登录的页面
        if(Store.state.sessionId){
            next()
        }else{
            next('/login')
            next('/')
        }
    }
})