兼兼街公众号代码
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

  1. import Vue from 'vue'
  2. import Router from 'uni-simple-router'
  3. import store from '../store'
  4. Vue.use(Router)
  5. //初始化
  6. const router = new Router({
  7. APP: {
  8. animation: {
  9. animationType: 'pop-in',
  10. animationDuration: 300
  11. }
  12. },
  13. encodeURI: false,
  14. routes: ROUTES //路由表
  15. });
  16. //全局路由前置守卫
  17. // router.beforeEach((to, from, next) => {
  18. // // 有两个个判断条件,一个是token,还有一个路由元信息
  19. // let userInfo = Boolean(uni.getStorageSync('userInfo'));
  20. // let token = uni.getStorageSync('userToken');
  21. // // 权限控制
  22. // if(!token){
  23. // uni.reLaunch({
  24. // url: '/pages/login/login'
  25. // });
  26. // }
  27. // next()
  28. // // if (to.meta && to.meta.auth && !userInfo) {
  29. // // store.commit('LOGIN_TIP', true)
  30. // // } else {
  31. // // }
  32. // })
  33. // 全局路由后置守卫
  34. router.afterEach((to, from) => {})
  35. export default router;