
- 发布:2024-11-05 14:03
- 更新:2025-01-06 16:26
- 阅读:218
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: 64
HBuilderX类型: 正式
HBuilderX版本号: 4.32
手机系统: 全部
手机厂商: 华为
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
测试过的手机:
示例代码:
preLogin(){
// #ifdef APP-PLUS
uni.preLogin({
provider: 'univerify',
success:()=>{ //预登录成功
//继续走一键登录
this.onlyKeyLogin()
},
fail:(res)=>{ // 预登录失败
}
})
// #endif
},
onlyKeyLogin() {
// 显示一键登录选项
uni.login({
provider: 'univerify',
univerifyStyle: {
fullScreen: true
},
success:(res)=> { // 登录成功
console.log("res====================" + JSON.stringify(res));
},
fail: (error) => { // 登录失败
if (error.code == 30002 || error.code==30003) { //切花其他方式登录,关闭按钮
uni.closeAuthView()
} else {
console.log("error: " + JSON.stringify(error));
uni.showToast({
title : '一键登录失败',icon:"none"
})
uni.closeAuthView()
}
}
})
}
preLogin(){
// #ifdef APP-PLUS
uni.preLogin({
provider: 'univerify',
success:()=>{ //预登录成功
//继续走一键登录
this.onlyKeyLogin()
},
fail:(res)=>{ // 预登录失败
}
})
// #endif
},
onlyKeyLogin() {
// 显示一键登录选项
uni.login({
provider: 'univerify',
univerifyStyle: {
fullScreen: true
},
success:(res)=> { // 登录成功
console.log("res====================" + JSON.stringify(res));
},
fail: (error) => { // 登录失败
if (error.code == 30002 || error.code==30003) { //切花其他方式登录,关闭按钮
uni.closeAuthView()
} else {
console.log("error: " + JSON.stringify(error));
uni.showToast({
title : '一键登录失败',icon:"none"
})
uni.closeAuthView()
}
}
})
}
操作步骤:
preLogin(){
// #ifdef APP-PLUS
uni.preLogin({
provider: 'univerify',
success:()=>{ //预登录成功
//继续走一键登录
this.onlyKeyLogin()
},
fail:(res)=>{ // 预登录失败
}
})
// #endif
},
onlyKeyLogin() {
// 显示一键登录选项
uni.login({
provider: 'univerify',
univerifyStyle: {
fullScreen: true
},
success:(res)=> { // 登录成功
console.log("res====================" + JSON.stringify(res));
},
fail: (error) => { // 登录失败
if (error.code == 30002 || error.code==30003) { //切花其他方式登录,关闭按钮
uni.closeAuthView()
} else {
console.log("error: " + JSON.stringify(error));
uni.showToast({
title : '一键登录失败',icon:"none"
})
uni.closeAuthView()
}
}
})
}
preLogin(){
// #ifdef APP-PLUS
uni.preLogin({
provider: 'univerify',
success:()=>{ //预登录成功
//继续走一键登录
this.onlyKeyLogin()
},
fail:(res)=>{ // 预登录失败
}
})
// #endif
},
onlyKeyLogin() {
// 显示一键登录选项
uni.login({
provider: 'univerify',
univerifyStyle: {
fullScreen: true
},
success:(res)=> { // 登录成功
console.log("res====================" + JSON.stringify(res));
},
fail: (error) => { // 登录失败
if (error.code == 30002 || error.code==30003) { //切花其他方式登录,关闭按钮
uni.closeAuthView()
} else {
console.log("error: " + JSON.stringify(error));
uni.showToast({
title : '一键登录失败',icon:"none"
})
uni.closeAuthView()
}
}
})
}
预期结果:
拉起一键登录界面后,不显示转圈圈,用户可以点击界面上的登录按钮,与右上角关闭按钮;
拉起一键登录界面后,不显示转圈圈,用户可以点击界面上的登录按钮,与右上角关闭按钮;
实际结果:
卡在转圈圈界面,无法点击界面上任何东西
卡在转圈圈界面,无法点击界面上任何东西
bug描述:
预登录成功后,走了uni.login , 成功弹出一键登录的界面了, 但是界面会出现一个转圈圈, 用户在界面上操作无法点击 本机号码一键登录, 也无法关闭。
偶发性的,大部分用户都是正常的,但是有少部分用户出现这种情况, 问了个推的一键登录技术人员, 排查了日志与函数情况也正常,
按他的意思,好像没回调;
(本机号码一键登录 用户不是点了界面中 本机号码一键登录 这个才出现转圈圈,而是这个一键登录界面拉起了就出现转圈圈,然后就卡在这)
3 个回复
m***@163.com (作者)
HBuilderX版本号 是4. 28 , 刚刚选错了
m***@163.com (作者)
i***@torch-cn.com
请问解决了吗