最新
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1044
pages/user/index.vue
1044
pages/user/index.vue
File diff suppressed because it is too large
Load Diff
@@ -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 token = store.getters.getToken || uni.getStorageSync('token')
|
||||||
const openId = store.getters.getOpenId || uni.getStorageSync('openId')
|
const openId = store.getters.getOpenId || uni.getStorageSync('openId')
|
||||||
if(to.name === 'appESign'){
|
if(to.name === 'appESign'){
|
||||||
next()
|
next()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 检查用户是否授权了微信
|
// 检查用户是否授权了微信
|
||||||
if(to.name != 'webWechatIndex' && openId === ''){
|
if(to.name != 'webWechatIndex' && openId === ''){
|
||||||
authFollow({
|
authFollow({
|
||||||
// url: 'https://web.douhuotest.douhuofalv.com/webWechat/index'
|
// url: 'https://web.douhuotest.douhuofalv.com/webWechat/index'
|
||||||
url: 'https://web.douhuofalv.com/webWechat/index'
|
url: 'https://web.douhuofalv.com/webWechat/index'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
@@ -43,7 +43,7 @@ router.beforeEach((to, from, next) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查是否需要登录
|
// 检查是否需要登录
|
||||||
if(to.auth && token === ''){
|
if(to.auth && token === ''){
|
||||||
@@ -60,7 +60,7 @@ router.beforeEach((to, from, next) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// 全局路由后置守卫
|
// 全局路由后置守卫
|
||||||
router.afterEach((to, from) => {
|
router.afterEach((to, from) => {
|
||||||
// console.log('跳转结束--暂无应用场景')
|
// console.log('跳转结束--暂无应用场景')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user