提交 19a7b5e7 编写于 作者: 雪洛's avatar 雪洛

docs: update univerify demo

上级 1eac793d
......@@ -58,20 +58,22 @@ keyword: 手机号
云函数内接口调用形式如下
```js
const res = await uniCloud.getPhoneNumber({
exports.main = async function(event, context){
const res = await uniCloud.getPhoneNumber({
provider: 'univerify',
appid: '_UNI_ABCDEFG', // 替换成自己开通一键登录的应用的DCloud appid
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'
// }
})
// 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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册