This commit is contained in:
2023-07-07 10:10:51 +08:00
parent be6d4622bc
commit 1af9e0eda5
4 changed files with 2722 additions and 2725 deletions

View File

@@ -1,4 +1,4 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
@@ -22,16 +22,16 @@ const router = createRouter({
})
// 全局路由前置守卫
router.beforeEach((to, from, next) => {
router.beforeEach((to, from, next) => {
const token = store.getters.getToken || uni.getStorageSync('token')
const openId = store.getters.getOpenId || uni.getStorageSync('openId')
if(to.name === 'appESign'){
next()
return
const openId = store.getters.getOpenId || uni.getStorageSync('openId')
if(to.name === 'appESign'){
next()
return
}
// 检查用户是否授权了微信
if(to.name != 'webWechatIndex' && openId === ''){
authFollow({
authFollow({
// url: 'https://web.douhuotest.douhuofalv.com/webWechat/index'
url: 'https://web.douhuofalv.com/webWechat/index'
}).then(res => {
@@ -43,7 +43,7 @@ router.beforeEach((to, from, next) => {
})
})
return
}
}
// 检查是否需要登录
if(to.auth && token === ''){
@@ -60,7 +60,7 @@ router.beforeEach((to, from, next) => {
})
// 全局路由后置守卫
router.afterEach((to, from) => {
router.afterEach((to, from) => {
// console.log('跳转结束--暂无应用场景')
})