fix: 授权登录逻辑调整
parent
0c2339522f
commit
22f4c1f298
|
|
@ -81,6 +81,8 @@ const show = ref(false)
|
|||
const checked = ref([]) // 是否同意条款
|
||||
const getPhoneInfo = ref(null)
|
||||
|
||||
const scene = ref('')
|
||||
|
||||
const getPhoneNumber = async (e: any) => {
|
||||
if (e.detail.errMsg == 'getPhoneNumber:ok') {
|
||||
const detail = e.detail
|
||||
|
|
@ -189,6 +191,8 @@ const getUserInfo = async (_code: string) => {
|
|||
// 个人信息初始化
|
||||
if (infoData.userExtend && !infoData.userExtend.init) {
|
||||
uni.navigateTo({ url: '/login-sub/inviteCode' })
|
||||
} else if (scene.value !== '') {
|
||||
uni.navigateTo({ url: `/pages/index/index?scene=${scene.value}` })
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url: '/pages/home/index/index',
|
||||
|
|
@ -205,6 +209,11 @@ const getUserInfo = async (_code: string) => {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
// 如果是授权登录页面回来,则要回去授权页面
|
||||
scene.value = options.scene || ''
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
|
|
@ -32,14 +32,14 @@ import { useUserStore } from '@/store/user'
|
|||
|
||||
const userStore = useUserStore()
|
||||
|
||||
let scene = ''
|
||||
let scene = ref('')
|
||||
const handleCancel = () => {
|
||||
uni.switchTab({ url: '/pages/home/index/index' })
|
||||
}
|
||||
|
||||
const handleAuthPage = () => {
|
||||
authQrCode({
|
||||
userCode: scene,
|
||||
userCode: scene.value,
|
||||
messageType: 2,
|
||||
weChat: { openId: userStore.userInfo.openid, sessionKey: '', unionId: '' },
|
||||
}).then((resp) => {
|
||||
|
|
@ -63,6 +63,13 @@ const handleAuthPage = () => {
|
|||
}
|
||||
|
||||
onLoad((options) => {
|
||||
scene = options.scene || ''
|
||||
scene.value = options.scene || ''
|
||||
console.log('用户是否登录了', userStore.isLoginFlag)
|
||||
|
||||
if (!userStore.isLoginFlag) {
|
||||
uni.navigateTo({
|
||||
url: `/login-sub/index?scene=${scene.value}`,
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue