一键登录模块

This commit is contained in:
唐明明
2021-07-23 14:30:06 +08:00
parent 564ed944d4
commit 8407323932
23 changed files with 4088 additions and 50 deletions

View File

@@ -6,7 +6,7 @@
*/
import { RouterMount, createRouter } from 'uni-simple-router';
// import store from '../store/index'
import store from '../store/index'
const router = createRouter({
platform: process.env.VUE_APP_PLATFORM,
@@ -15,23 +15,21 @@ const router = createRouter({
// 全局路由前置守卫
router.beforeEach((to, from, next) => {
console.log(to)
console.log(from)
// const token = store.getters.getToken || uni.getStorageSync('token')
// if(to.meta.auth && token === ''){
// next({
// name: 'Login',
// NAVTYPE: 'replaceAll'
// })
// return
// }
// if(to.name === 'Welcome'){
// next({
// name: 'ChainIndex',
// NAVTYPE: 'replaceAll'
// })
// return
// }
const token = store.getters.getToken || uni.getStorageSync('token')
if(to.meta.auth && token === ''){
next({
name: 'Login',
NAVTYPE: 'replaceAll'
})
return
}
if(to.name === 'Welcome'){
next({
name: 'ChainIndex',
NAVTYPE: 'replaceAll'
})
return
}
next();
})