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

docs: update univerify demo

上级 1eac793d
...@@ -58,20 +58,22 @@ keyword: 手机号 ...@@ -58,20 +58,22 @@ keyword: 手机号
云函数内接口调用形式如下 云函数内接口调用形式如下
```js ```js
const res = await uniCloud.getPhoneNumber({ exports.main = async function(event, context){
provider: 'univerify', const res = await uniCloud.getPhoneNumber({
appid: '_UNI_ABCDEFG', // 替换成自己开通一键登录的应用的DCloud appid provider: 'univerify',
apiKey: 'xxx', // 在开发者中心开通服务并获取apiKey appid: context.APPID, // 客户端callFunction时携带的AppId信息
apiSecret: 'xxx', // 在开发者中心开通服务并获取apiSecret apiKey: 'xxx', // 在开发者中心开通服务并获取apiKey
access_token: event.access_token, apiSecret: 'xxx', // 在开发者中心开通服务并获取apiSecret
openid: event.openid access_token: event.access_token,
}) openid: event.openid
// res形式如下 })
// { // res形式如下
// code: 0, // {
// message: '', // code: 0,
// phoneNumber: '138xxxxxxxx' // message: '',
// } // phoneNumber: '138xxxxxxxx'
// }
}
``` ```
**相关文档** **相关文档**
...@@ -100,9 +102,9 @@ uniCloud.callFunction({ ...@@ -100,9 +102,9 @@ uniCloud.callFunction({
}) })
// 云函数 // 云函数
exports.main = async function (event){ exports.main = async function (event, context){
const res = await uniCloud.getPhoneNumber({ const res = await uniCloud.getPhoneNumber({
appid: '_UNI_ABCDEFG', // 替换成自己开通一键登录的应用的DCloud appid appid: context.APPID, // 客户端callFunction时携带的AppId信息
provider: 'univerify', provider: 'univerify',
apiKey: 'xxx', // 在开发者中心开通服务并获取apiKey apiKey: 'xxx', // 在开发者中心开通服务并获取apiKey
apiSecret: 'xxx', // 在开发者中心开通服务并获取apiSecret apiSecret: 'xxx', // 在开发者中心开通服务并获取apiSecret
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册