调试接口
This commit is contained in:
@ -48,6 +48,13 @@
|
||||
// 服务协议条款
|
||||
const agree = ref<boolean>(false)
|
||||
|
||||
const redirectUrl = ref<string>('')
|
||||
|
||||
onLoad((args) => {
|
||||
console.log("🚀 ~ login args:", args)
|
||||
redirectUrl.value = args.redirect || ''
|
||||
})
|
||||
|
||||
const Login = {
|
||||
// 获取手机号
|
||||
handleLogin: async (e: object) => {
|
||||
@ -55,13 +62,27 @@
|
||||
toast.info('请同意服务协议和隐私政策')
|
||||
return
|
||||
}
|
||||
|
||||
const userStore = useUserStore()
|
||||
const res = await userStore.wxLogin()
|
||||
if (res) {
|
||||
toast.info('登录成功')
|
||||
router.navigateBack(1, 500)
|
||||
|
||||
uni.showLoading({
|
||||
title: '登录中...',
|
||||
mask: true
|
||||
})
|
||||
try {
|
||||
const userStore = useUserStore()
|
||||
const res = await userStore.wxLogin()
|
||||
uni.hideLoading()
|
||||
if (res) {
|
||||
toast.info('登录成功')
|
||||
if (redirectUrl.value) {
|
||||
router.redirectTo(redirectUrl.value)
|
||||
} else {
|
||||
router.navigateBack(1, 500)
|
||||
}
|
||||
}
|
||||
} catch(error) {
|
||||
uni.hideLoading()
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// 手机登录
|
||||
|
||||
Reference in New Issue
Block a user