|
|
@@ -11,28 +11,23 @@ router.beforeEach((to, from, next) => {
|
|
|
let token = to.query.token;
|
|
|
let m_id = to.query.m_id;
|
|
|
if (token && m_id) {
|
|
|
- // store.commit("setCookie", { 'token': token, 'm_id': m_id });
|
|
|
uni.setStorageSync('token',token);
|
|
|
uni.setStorageSync('m_id',m_id);
|
|
|
next('/pages/index/index');
|
|
|
}
|
|
|
const userToken = uni.getStorageSync('token')
|
|
|
const userMid = uni.getStorageSync('m_id')
|
|
|
- console.log('登陆信息-------'+userToken+'--------------'+userMid)
|
|
|
if((!userToken || !userMid) && whiteList.indexOf(to.fullPath)<0){
|
|
|
- console.log('暂无登陆信息')
|
|
|
- console.log(to.fullPath )
|
|
|
if(to.fullPath!=='/pages/login/index'){
|
|
|
- next('/pages/login/index');
|
|
|
+ // next('/pages/login/index');
|
|
|
}
|
|
|
}
|
|
|
- console.log('前置守卫to----------', to)
|
|
|
next();
|
|
|
|
|
|
});
|
|
|
// 全局路由后置守卫
|
|
|
router.afterEach((to, from) => {
|
|
|
- console.log('后置守卫to------', to)
|
|
|
+ // console.log('后置守卫to------', to)
|
|
|
})
|
|
|
|
|
|
export {
|