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

docs: 移除文档中的短信smsKey、一键登录apiKey相关说明

上级 7fbbc00d
......@@ -901,8 +901,6 @@ exports.main = async (event, context) => {
let sendSmsRes = await uniCloud.sendSms({
phoneList,
appid: '__UNI__xxxxxxx',
smsKey: '****************',
smsSecret: '****************',
templateId: '100**', // 请替换为自己申请的模板id
data: {
text1: 'xxx',
......
......@@ -21,8 +21,8 @@
|参数名 |类型 |必填 |说明 |
|:-: |:-: |:-: |:-: |
|appid |String |是 |DCloud appid,可以在项目manifest.json内看到 |
|smsKey |String |是 |`HBuilderX 3.91`及之后的版本可不填此参数,调用短信接口的密钥key,部分模板/插件的旧版本仍会检查配置,请阅读注意事项 |
|smsSecret |String |是 |`HBuilderX 3.91`及之后的版本可不填此参数,调用短信接口的密钥secret,部分模板/插件的旧版本仍会检查配置,请阅读注意事项 |
|~~smsKey~~ |String |是 |`HBuilderX 3.91`及之后的版本可不填此参数,调用短信接口的密钥key,部分模板/插件的旧版本仍会检查配置,请阅读注意事项 |
|~~smsSecret~~ |String |是 |`HBuilderX 3.91`及之后的版本可不填此参数,调用短信接口的密钥secret,部分模板/插件的旧版本仍会检查配置,请阅读注意事项 |
|phone |String |和phoneList二选一|发送目标手机号,暂仅支持中国大陆手机号 |
|phoneList |Array |和phone二选一 |发送目标手机号,暂仅支持中国大陆手机号,最多50个手机号码,`HBuilderX 3.3.0`起支持 |
|templateId |String |是 |模版Id,短信内容为固定模板,详见下方说明(应用开发阶段,可以使用 DCloud 提供的测试模板) |
......@@ -109,8 +109,8 @@
|:-: |:-: |
|1001 |参数校验未通过,errMsg内会给出详细信息|
|4000 |参数错误 |
|4001 |apiKey 不存在 或 templateId 不正确 |
|4002 |请检查smsKey、smsSecret是否有误 |
|4001 |smsKey 不存在 或 templateId 不正确 |
|~~4002~~ |请检查smsKey、smsSecret是否有误 |
|4003 |服务空间或IP地址不在白名单中 |
|5000 |服务错误,请联系DCloud进行排查 |
|5001 |服务器异常,请重试! |
......@@ -124,8 +124,6 @@ exports.main = async (event, context) => {
try {
const res = await uniCloud.sendSms({
appid: '__UNI__xxxxxxx',
smsKey: '****************', // `HBuilderX 3.91`及之后的版本可不填此参数
smsSecret: '****************', // `HBuilderX 3.91`及之后的版本可不填此参数
phone: '188********',
templateId: '100**', // 请替换为自己申请的模板id
data: {
......@@ -153,8 +151,6 @@ exports.main = async (event, context) => {
try {
const res = await uniCloud.sendSms({
appid: '__UNI__xxxxxxx',
smsKey: '****************', // `HBuilderX 3.91`及之后的版本可不填此参数
smsSecret: '****************', // `HBuilderX 3.91`及之后的版本可不填此参数
phoneList: ['188********', '138********'],
templateId: '100**', // 请替换为自己申请的模板id
data: {
......
......@@ -432,8 +432,6 @@ exports.main = async function(event, context) {
} = JSON.parse(event.body)
const res = await uniCloud.sendSms({
appid: '__UNI__xxxxxxx', // DCloud AppId
smsKey: '****************', // 短信服务smsKey
smsSecret: '****************', // 短信服务smsSecret
phone: phone,
templateId: templateId, // 请替换为自己申请的模板id
data: data // 短信模板字段
......
......@@ -1904,8 +1904,7 @@ module.exports = {
### 一键登录
一键登录是运营商提供的、比短信验证码更方便、更安全、更便宜的方案。[详见](https://uniapp.dcloud.net.cn/univerify)
- 使用本功能需要在[DCloud开发者中心 -> ](https://dev.dcloud.net.cn/pages/uniLogin/index)开通并充值
- 模块配置:`manifest.json`-->`App模块配置` -->`OAuth(登录鉴权)`-->` 一键登录`,点击后面的`开通配置`,在随后打开的web界面中,同意协议,并点击充值按钮充值。如只是测试,可以只充值1元钱。如果你已经确定包名,则可以在web界面点击“添加应用”,提交审核。这个是正式打包必须的。真机运行可以跳过此环节。记住页面上展示的`apiKey``apiSecret`,下一步需要用到。
- uni-id配置:`uni-id配置文件` --> `service` --> `univerify`,填写`appid``apiKey``apiSecret``appid`就是`manifest`里的`appid``apiKey``apiSecret`则是从上一步的web界面得来的。
- 模块配置:`manifest.json`-->`App模块配置` -->`OAuth(登录鉴权)`-->` 一键登录`,点击后面的`开通配置`,在随后打开的web界面中,同意协议,并点击充值按钮充值。如只是测试,可以只充值1元钱。如果你已经确定包名,则可以在web界面点击“添加应用”,提交审核。这个是正式打包必须的。真机运行可以跳过此环节。
### 微信登录@weixinLogin
......
......@@ -214,9 +214,7 @@ exports.main = async (event, context) => {
"service": {
"sms": {
"name": "your app name", // 应用名称,对应短信模版的name
"codeExpiresIn": 180, // 验证码过期时间,单位为秒,注意一定要是60的整数倍
"smsKey": "your sms key", // 短信密钥key,开通短信服务处可以看到
"smsSecret": "your sms secret" // 短信密钥secret,开通短信服务处可以看到
"codeExpiresIn": 180 // 验证码过期时间,单位为秒,注意一定要是60的整数倍
},
"univerify": {
"appid": "your appid" // 当前应用的appid,使用云函数URL化,此项必须配置
......@@ -1366,9 +1364,7 @@ uniID.init({ // 如果在此处传入配置信息则不会再使用config.json
"service": {
"sms": {
"name": "your app name", // 应用名称对应uniCloud.sendSms的data参数内的name
"codeExpiresIn": 180, // 验证码过期时间,单位:秒,只可取60的整数倍,不填此参数时会取默认值180秒
"smsKey": "your sms key", // 短信密钥key
"smsSecret": "your sms secret" // 短信密钥secret
"codeExpiresIn": 180 // 验证码过期时间,单位:秒,只可取60的整数倍,不填此参数时会取默认值180秒
}
}
})
......
......@@ -285,8 +285,6 @@ uni-id的云端配置文件在`uniCloud/cloudfunctions/common/uni-config-center/
"sms": {
"name": "", // 应用名称,对应短信模版的name
"codeExpiresIn": 180, // 验证码过期时间,单位为秒,注意一定要是60的整数倍
"smsKey": "", // uni-id-co 1.1.17及以上版本无需填写,短信密钥key,开通短信服务处可以看到
"smsSecret": "", // uni-id-co 1.1.17及以上版本无需填写,短信密钥secret,开通短信服务处可以看到
"scene": {
"bind-mobile-by-sms": { // 对绑定手机号场景的配置,短信验证码场景值参考:https://uniapp.dcloud.net.cn/uniCloud/uni-id/summary.html#sms-scene
"templateId": "", // 绑定手机号使用的短信验证码模板
......@@ -295,9 +293,7 @@ uni-id的云端配置文件在`uniCloud/cloudfunctions/common/uni-config-center/
}
},
"univerify": {
"appid": "", // uni-id-co 1.1.17及以上版本无需填写,当前应用的appid,使用云函数URL化,此项必须配置
"apiKey": "", // uni-id-co 1.1.17及以上版本无需填写,apiKey apiSecret 在开发者中心获取,开发者中心:https://dev.dcloud.net.cn/pages/uniLogin/index,文档:https://ask.dcloud.net.cn/article/37965
"apiSecret": ""
"appid": "" // uni-id-co 1.1.17及以上版本无需填写,当前应用的appid,使用云函数URL化,此项必须配置
}
}
}
......
......@@ -62,8 +62,6 @@ exports.main = async function(event, context){
const res = await uniCloud.getPhoneNumber({
provider: 'univerify',
appid: context.APPID, // 客户端callFunction时携带的AppId信息
apiKey: 'xxx', // HBuilderX 3.94及以上版本可以不传此参数,部分模板/插件的旧版本仍会检查配置,请阅读注意事项
apiSecret: 'xxx', // HBuilderX 3.94及以上版本可以不传此参数,部分模板/插件的旧版本仍会检查配置,请阅读注意事项
access_token: event.access_token,
openid: event.openid
})
......@@ -83,7 +81,7 @@ exports.main = async function(event, context){
**注意**
- 由于历史原因,如果未关联uni-cloud-verify扩展库也可能会在不填写apiKey时提示缺少apiKey,请主动为云函数关联uni-cloud-verify扩展库
- 如下插件需要升级后才不会检查smsKey、smsSecret必填,如果使用uni-id公共模块需要更新到3.3.31版本,如果使用uni-id-pages需要更新到1.1.17版本,如果使用了uni-starter需要更新到2.1.6版本
- 如下插件需要升级后才不会检查apiKey、apiSecret必填,如果使用uni-id公共模块需要更新到3.3.31版本,如果使用uni-id-pages需要更新到1.1.17版本,如果使用了uni-starter需要更新到2.1.6版本
### uni-app项目@uni-app
......
......@@ -62,8 +62,6 @@ 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
})
......@@ -106,8 +104,6 @@ exports.main = async function (event, context){
const res = await uniCloud.getPhoneNumber({
appid: context.APPID, // 客户端callFunction时携带的AppId信息
provider: 'univerify',
apiKey: 'xxx', // 在开发者中心开通服务并获取apiKey
apiSecret: 'xxx', // 在开发者中心开通服务并获取apiSecret
access_token: event.access_token,
openid: event.openid
})
......@@ -156,8 +152,6 @@ exports.main = async function(event){
const res = await uniCloud.getPhoneNumber({
provider: 'univerify',
appid: 'xxx', // DCloud appid
apiKey: 'xxx', // 在开发者中心开通服务并获取apiKey
apiSecret: 'xxx', // 在开发者中心开通服务并获取apiSecret
access_token: access_token,
openid: openid
})
......@@ -226,8 +220,6 @@ exports.main = async function (event){
const res = await uniCloud.getPhoneNumber({
provider: 'univerify',
appid: 'xxx', // DCloud appid
apiKey: 'xxx', // 在开发者中心开通服务并获取apiKey
apiSecret: 'xxx', // 在开发者中心开通服务并获取apiSecret
access_token: access_token,
openid: openid
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册