工作台

This commit is contained in:
唐明明
2022-12-26 09:31:55 +08:00
parent f7d357f738
commit 1f3f6b230a
218 changed files with 19796 additions and 0 deletions

35
router/index.js Normal file
View File

@@ -0,0 +1,35 @@
import {
RouterMount,
createRouter
} from 'uni-simple-router';
import store from '@/store/index'
const router = createRouter({
platform: process.env.VUE_APP_PLATFORM,
routes: [...ROUTES]
});
//全局路由前置守卫
router.beforeEach((to, from, next) => {
let isToken = store.getters.getToken === '' || uni.getStorageSync('token') === ''
if(to.auth != undefined){
if(to.auth && isToken){
next({
name: 'Auth',
NAVTYPE: 'push'
})
return
}
}
next();
});
// 全局路由后置守卫
router.afterEach((to, from) => {
})
export {
router,
RouterMount
}