兼兼街公众号代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

37 lines
864 B

import Vue from 'vue'
import Router from 'uni-simple-router'
import store from '../store'
Vue.use(Router)
//初始化
const router = new Router({
APP: {
animation: {
animationType: 'pop-in',
animationDuration: 300
}
},
encodeURI: false,
routes: ROUTES //路由表
});
//全局路由前置守卫
// router.beforeEach((to, from, next) => {
// // 有两个个判断条件,一个是token,还有一个路由元信息
// let userInfo = Boolean(uni.getStorageSync('userInfo'));
// let token = uni.getStorageSync('userToken');
// // 权限控制
// if(!token){
// uni.reLaunch({
// url: '/pages/login/login'
// });
// }
// next()
// // if (to.meta && to.meta.auth && !userInfo) {
// // store.commit('LOGIN_TIP', true)
// // } else {
// // }
// })
// 全局路由后置守卫
router.afterEach((to, from) => {})
export default router;