lingcf
lingcf
  • 发布:2025-01-05 16:59
  • 更新:2025-12-04 15:00
  • 阅读:269

uni一键登录手机真机调试报错:获取手机号失败,请稍后重试

分类:uni-app

HBuilder版本4.44,参考 https://uniapp.dcloud.net.cn/univerify.html 编写云函数后,使用标准基座进行真机调试时(连接本地云函数),出现报错。【连接手机进行的调试,而且电脑端使用的是手机热点】

'use strict';  
exports.main = async (event, context) => {  
  const res = await uniCloud.getPhoneNumber({  
      appid: 'xxx', // 已将这一块替换成一键登录中添加的应用ID  
      provider: 'univerify',  
      access_token: event.access_token,  
      openid: event.openid  
  })  

  console.log(res); // res里包含手机号  
  return {  
    code: 0,  
    message: '获取手机号成功'  
  }  
}

Error: 获取手机号失败,请稍后重试。
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async global.__tempModuleExports.exports.main

官网上有说明:应用开通uni一键登录服务后,需要等审核通过后才能正式使用。在审核期间可以使用HBuilder标准基座真机运行调用一键登录功能,调用时会从你的账户中扣费;

我的应用目前在审核中,也进行了一键登录充值。

2025-01-05 16:59 负责人:无 分享
已邀请:
t***@gmail.com

t***@gmail.com

有解决吗 题主

要回复问题请先登录注册