index.js 457 字节
Newer Older
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
1
'use strict';
2
exports.main = async function(event, context) {
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
3
  const res = await uniCloud.getPhoneNumber({
4
    appid: context.appId, // 替换成自己开通一键登录的应用的DCloud appid
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
5 6 7 8 9 10
    provider: 'univerify',
    access_token: event.access_token,
    openid: event.openid
  })
  // 执行入库等操作,正常情况下不要把完整手机号返回给前端
  return {
11 12
    errCode: 0,
    errMsg: '获取手机号成功',
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
13 14 15
    res: res
  }
}