Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
unidocs-unicloud-zh
提交
d318f1df
U
unidocs-unicloud-zh
项目概览
DCloud
/
unidocs-unicloud-zh
通知
124
Star
4
Fork
31
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
2
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
unidocs-unicloud-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
d318f1df
编写于
2月 23, 2024
作者:
雪洛
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs: 移除文档中的短信smsKey、一键登录apiKey相关说明
上级
7fbbc00d
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
9 addition
and
36 deletion
+9
-36
docs/cf-functions.md
docs/cf-functions.md
+0
-2
docs/sms/dev.md
docs/sms/dev.md
+4
-8
docs/uni-cloud-s2s.md
docs/uni-cloud-s2s.md
+0
-2
docs/uni-id/cloud-object.md
docs/uni-id/cloud-object.md
+1
-2
docs/uni-id/old.md
docs/uni-id/old.md
+2
-6
docs/uni-id/summary.md
docs/uni-id/summary.md
+1
-5
docs/uni-login/dev.md
docs/uni-login/dev.md
+1
-3
docs/univerify.md
docs/univerify.md
+0
-8
未找到文件。
docs/cf-functions.md
浏览文件 @
d318f1df
...
...
@@ -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
'
,
...
...
docs/sms/dev.md
浏览文件 @
d318f1df
...
...
@@ -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 |
api
Key 不存在 或 templateId 不正确 |
|
4002
|请检查smsKey、smsSecret是否有误 |
|4001 |
sms
Key 不存在 或 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
:
{
...
...
docs/uni-cloud-s2s.md
浏览文件 @
d318f1df
...
...
@@ -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
// 短信模板字段
...
...
docs/uni-id/cloud-object.md
浏览文件 @
d318f1df
...
...
@@ -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
...
...
docs/uni-id/old.md
浏览文件 @
d318f1df
...
...
@@ -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秒
}
}
})
...
...
docs/uni-id/summary.md
浏览文件 @
d318f1df
...
...
@@ -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化,此项必须配置
}
}
}
...
...
docs/uni-login/dev.md
浏览文件 @
d318f1df
...
...
@@ -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、sms
Secret必填,如果使用uni-id公共模块需要更新到3.3.31版本,如果使用uni-id-pages需要更新到1.1.17版本,如果使用了uni-starter需要更新到2.1.6版本
-
如下插件需要升级后才不会检查
apiKey、api
Secret必填,如果使用uni-id公共模块需要更新到3.3.31版本,如果使用uni-id-pages需要更新到1.1.17版本,如果使用了uni-starter需要更新到2.1.6版本
### uni-app项目@uni-app
...
...
docs/univerify.md
浏览文件 @
d318f1df
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录