2***@qq.com
2***@qq.com
  • 发布:2023-08-12 20:03
  • 更新:2023-08-12 22:23
  • 阅读:292

uni-app打包App使用uni.login报错 login fail

分类:uni-app

uni.login({
provider: 'weixin',
success: function(loginRes) {
// 获取用户信息
uni.getUserInfo({
provider: 'weixin',
success: function(infoRes) {
self.appUserInfo = infoRes.userInfo
if( infoRes.userInfo){
self.wxLoginApi()
}else{
uni.showModal({
content: '没有获取到授权,请重新点击按钮授权登陆',
showCancel: false
});
}
},
fail() {
uni.showToast({
title: '获取用户信息失败',
icon: 'none',
duration: 2000
})
},
complete() {
uni.hideLoading()
}
});
},
fail(ex) {
console.log("失败原因",ex)
uni.hideLoading()
uni.showToast({
title: "失败原因:"+ex.errMsg,
icon: 'none',
duration: 2000

                    })  
                }  
            });  

2023-08-12 20:03 负责人:无 分享
已邀请:
喜欢技术的前端

喜欢技术的前端 - QQ---445849201

要回复问题请先登录注册