MarginTop
MarginTop
  • 发布:2023-04-21 17:55
  • 更新:2023-04-21 19:09
  • 阅读:169

【报Bug】本机号码一键登录一直在加载中,有sim卡,并开启了数据流量

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: window10

HBuilderX类型: 正式

HBuilderX版本号: 3.7.9

手机系统: Android

手机系统版本号: Android 11

手机厂商: 华为

手机机型: p40pro

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:

本机号码一键登录

预期结果:

登录成功

实际结果:

无任何反应,一直在加载

bug描述:

本机号码一键登录一直在加载中,有sim卡,并开启了数据流量!

2023-04-21 17:55 负责人:无 分享
已邀请:
DCloud_Android_YJC

DCloud_Android_YJC

univerifyStyle贴出来看下

  • MarginTop (作者)

    uni.login({ //正式登录,弹出授权窗

    provider: 'univerify',

    univerifyStyle: { // 自定义登录框样式

    "fullScreen": true, // 是否全屏显示,true表示全屏模式,false表示非全屏模式,默认值为false。

    "backgroundColor": '#ffffff', // 授权页面背景颜色,默认值:#ffffff

    "phoneNum": {

    "color": "#54DBB3", // 手机号文字颜色 默认值:#000000

    "fontSize":24

    },

    "authButton": {

    "normalColor": "#27C396", // 授权按钮正常状态背景颜色 默认值:#3479f5

    "highlightColor": "#54DBB3", // 授权按钮按下状态背景颜色 默认值:#2861c5(仅ios支持)

    "disabledColor": "#999", // 授权按钮不可点击时背景颜色 默认值:#73aaf5(仅ios支持)

    "textColor": "#ffffff", // 授权按钮文字颜色 默认值:#ffffff

    "title": "本机号码一键登录" // 授权按钮文案 默认值:“本机号码一键登录”

    },

    "privacyTerms": {

    "defaultCheckBoxState": false, // 条款勾选框初始状态 默认值: true

    "isCenterHint": false, //未勾选服务条款时点击登录按钮的提示是否居中显示 默认值: false (3.7.13+ 版本支持)

    "checkBoxSize": 14, // 可选 条款勾选框大小,仅android支持

    "prefix": "已阅读并同意", // 条款前的文案 默认值:“我已阅读并同意”

    "suffix": "并使用本机号码登录", // 条款后的文案 默认值:“并使用本机号码登录”


                        },  

    },
    success(res) { // 正式登录成功
    console.log("res: " + JSON.stringify(res));
    // 在得到access_token后,通过callfunction调用云函数
    uniCloud.callFunction({
    name: 'getphone', // 云函数名称
    data: { //传给云函数的参数
    'access_token': res.authResult.access_token, // 客户端一键登录接口返回的access_token
    'openid': res.authResult.openid // 客户端一键登录接口返回的openid
    },
    success(callRes) {
    //that.$utils.reLaunchTo('/pages/tabbar/home')
    console.log({
    phone: that.$aes_encrypt(callRes.result),
    deviceId: that.$cache.getCache('clientid'),
    loginType: that.loginType
    })
    that.loadingShow = true
    that.$request(that.$api.user.mobileLogin, {
    phone: that.$aes_encrypt(callRes.result),
    loginType: that.loginType,
    deviceId: that.$cache.getCache('clientid')
    }).then(async res => {
    console.log("___________一键登入接口请求_______________")
    console.log({
    phone: that.$aes_encrypt(callRes.result),
    deviceId: that.$cache.getCache('clientid'),
    loginType: that.loginType
    })
    that.$cache.setCache('token', res.data)
    await that.$request(that.$api.user.basicInfo).then(bas => {
    that.loadingShow = false
    console.log(
    "___________一键登入后获取用户信息_______________"
    )
    console.log(bas)
    that.$cache.setCache('userInfo', bas.data)
    that.selectClient();
    })
    })
    },
    fail(callErr) {
    that.loadingShow = false
    uni.showToast({
    title: "登入失败",
    icon: 'error',
    duration: 2000
    });
    console.log('调用云函数出错' + callErr)
    },
    complete(res) {
    console.log('complete' + res)
    that.loadingShow = false
    uni.closeAuthView() //关闭授权登录界面
    }
    })
    },
    fail(err) { // 正式登录失败
    console.log(err.errCode)
    console.log(err.errMsg)
    that.loadingShow = false
    uni.closeAuthView() //关闭授权登录界面
    }
    })

    2023-04-21 18:04

MarginTop

MarginTop (作者) - Margin

找到原因了, 在phoneNum下面不能设置fontSize 一设置fontSize就不行了

  • DCloud_Android_YJC

    fontSize最大设置为22,应该是发生了UI遮挡,内部报错了

    2023-04-21 19:30

要回复问题请先登录注册