...
|
...
|
@@ -120,47 +120,61 @@ const oneClickLoginHandler = () => { |
|
|
},
|
|
|
otherLoginButton: {
|
|
|
visible: false
|
|
|
},
|
|
|
privacyTerms: {
|
|
|
defaultCheckBoxState: false // 条款勾选框初始状态 默认值: true
|
|
|
}
|
|
|
},
|
|
|
async success(res) {
|
|
|
// 登录成功
|
|
|
console.log(res, '成功')
|
|
|
try {
|
|
|
const { result } = await doctorPhoneEasyLogin({ ...res.authResult, cid: uni.getStorageSync('cid') || '' })
|
|
|
|
|
|
uni.closeAuthView()
|
|
|
|
|
|
console.log(result, '一键登录')
|
|
|
// message.value = JSON.stringify(result)
|
|
|
// showMessage.value = true
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
uni.setStorageSync('token', result.token)
|
|
|
|
|
|
uni.setStorageSync('UserInfo', result.userInfo)
|
|
|
|
|
|
setTimeout(() => {
|
|
|
uni.$u.toast('登录成功')
|
|
|
}, 1000)
|
|
|
|
|
|
uni.reLaunch({ url: '/pages/index/index' })
|
|
|
// }, 800)
|
|
|
} catch (error) {
|
|
|
uni.$u.toast(error)
|
|
|
setTimeout(() => {
|
|
|
uni.closeAuthView()
|
|
|
}, 1000)
|
|
|
}
|
|
|
uni.getCheckBoxState({
|
|
|
async success(res) {
|
|
|
if (res.state) {
|
|
|
// 登录成功
|
|
|
console.log(res, '成功')
|
|
|
try {
|
|
|
const { result } = await doctorPhoneEasyLogin({ ...res.authResult, cid: uni.getStorageSync('cid') || '' })
|
|
|
|
|
|
uni.closeAuthView()
|
|
|
|
|
|
console.log(result, '一键登录')
|
|
|
// message.value = JSON.stringify(result)
|
|
|
// showMessage.value = true
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
uni.setStorageSync('token', result.token)
|
|
|
|
|
|
uni.setStorageSync('UserInfo', result.userInfo)
|
|
|
|
|
|
setTimeout(() => {
|
|
|
uni.$u.toast('登录成功')
|
|
|
}, 1000)
|
|
|
|
|
|
uni.reLaunch({ url: '/pages/index/index' })
|
|
|
// }, 800)
|
|
|
} catch (error) {
|
|
|
uni.$u.toast(error)
|
|
|
setTimeout(() => {
|
|
|
uni.closeAuthView()
|
|
|
}, 1000)
|
|
|
}
|
|
|
} else {
|
|
|
uni.$u.toast('请先同意阅读隐私协议')
|
|
|
}
|
|
|
console.log(res) // Boolean 用户是否勾选了选框
|
|
|
},
|
|
|
fail(res) {
|
|
|
console.log(res)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
fail(res) {
|
|
|
uni.$u.toast('网络错误')
|
|
|
console.log(res, '失败')
|
|
|
console.log(res.errMsg)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
defineExpose({ oneClickLoginHandler })
|
|
|
defineExpose({ oneClickLoginHandler, isConfirmProtocol })
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
...
|
...
|
|