diff --git a/docs/uniCloud/univerify.md b/docs/uniCloud/univerify.md index 1826f95e4eb7665052ab4c45b3f1f59065e6f863..1aae8869a6e7766c68f79f26ad1ee124e1ee7559 100644 --- a/docs/uniCloud/univerify.md +++ b/docs/uniCloud/univerify.md @@ -58,20 +58,22 @@ keyword: 手机号 云函数内接口调用形式如下 ```js -const res = await uniCloud.getPhoneNumber({ - provider: 'univerify', - appid: '_UNI_ABCDEFG', // 替换成自己开通一键登录的应用的DCloud appid - apiKey: 'xxx', // 在开发者中心开通服务并获取apiKey - apiSecret: 'xxx', // 在开发者中心开通服务并获取apiSecret - access_token: event.access_token, - openid: event.openid -}) -// res形式如下 -// { -// code: 0, -// message: '', -// phoneNumber: '138xxxxxxxx' -// } +exports.main = async function(event, context){ + const res = await uniCloud.getPhoneNumber({ + provider: 'univerify', + appid: context.APPID, // 客户端callFunction时携带的AppId信息 + apiKey: 'xxx', // 在开发者中心开通服务并获取apiKey + apiSecret: 'xxx', // 在开发者中心开通服务并获取apiSecret + access_token: event.access_token, + openid: event.openid + }) + // res形式如下 + // { + // code: 0, + // message: '', + // phoneNumber: '138xxxxxxxx' + // } +} ``` **相关文档** @@ -100,9 +102,9 @@ uniCloud.callFunction({ }) // 云函数 -exports.main = async function (event){ +exports.main = async function (event, context){ const res = await uniCloud.getPhoneNumber({ - appid: '_UNI_ABCDEFG', // 替换成自己开通一键登录的应用的DCloud appid + appid: context.APPID, // 客户端callFunction时携带的AppId信息 provider: 'univerify', apiKey: 'xxx', // 在开发者中心开通服务并获取apiKey apiSecret: 'xxx', // 在开发者中心开通服务并获取apiSecret