Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello_uni-id-pages
提交
34cbebfd
H
hello_uni-id-pages
项目概览
DCloud
/
hello_uni-id-pages
通知
1054
Star
31
Fork
43
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
2
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello_uni-id-pages
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
34cbebfd
编写于
2月 24, 2023
作者:
C
chenruilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(uni-id-co): requestAuthSecret 缺少为空判断
上级
f0de2a63
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
3 deletion
+15
-3
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/error.js
...d-pages/uniCloud/cloudfunctions/uni-id-co/common/error.js
+2
-1
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lang/en.js
...uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lang/en.js
+2
-1
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lang/zh-hans.js
...d-pages/uniCloud/cloudfunctions/uni-id-co/lang/zh-hans.js
+2
-1
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/verify-request-sign.js
...loudfunctions/uni-id-co/middleware/verify-request-sign.js
+9
-0
未找到文件。
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/error.js
浏览文件 @
34cbebfd
...
@@ -38,7 +38,8 @@ const ERROR = {
...
@@ -38,7 +38,8 @@ const ERROR = {
UNBIND_PASSWORD_NOT_EXISTS
:
'
uni-id-unbind-password-not-exists
'
,
UNBIND_PASSWORD_NOT_EXISTS
:
'
uni-id-unbind-password-not-exists
'
,
UNBIND_MOBILE_NOT_EXISTS
:
'
uni-id-unbind-mobile-not-exists
'
,
UNBIND_MOBILE_NOT_EXISTS
:
'
uni-id-unbind-mobile-not-exists
'
,
UNSUPPORTED_REQUEST
:
'
uni-id-unsupported-request
'
,
UNSUPPORTED_REQUEST
:
'
uni-id-unsupported-request
'
,
ILLEGAL_REQUEST
:
'
uni-id-illegal-request
'
ILLEGAL_REQUEST
:
'
uni-id-illegal-request
'
,
CONFIG_FIELD_REQUIRED
:
'
uni-id-config-field-required
'
}
}
function
isUniIdError
(
errCode
)
{
function
isUniIdError
(
errCode
)
{
...
...
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lang/en.js
浏览文件 @
34cbebfd
...
@@ -43,7 +43,8 @@ const sentence = {
...
@@ -43,7 +43,8 @@ const sentence = {
'
uni-id-unbind-mobile-not-exists
'
:
'
This is the only way to login at the moment, please bind your phone number and then try to unbind
'
,
'
uni-id-unbind-mobile-not-exists
'
:
'
This is the only way to login at the moment, please bind your phone number and then try to unbind
'
,
'
uni-id-unbind-password-not-exists
'
:
'
Please set a password first
'
,
'
uni-id-unbind-password-not-exists
'
:
'
Please set a password first
'
,
'
uni-id-unsupported-request
'
:
'
Unsupported request
'
,
'
uni-id-unsupported-request
'
:
'
Unsupported request
'
,
'
uni-id-illegal-request
'
:
'
Illegal request
'
'
uni-id-illegal-request
'
:
'
Illegal request
'
,
'
uni-id-config-field-required
'
:
'
Config field required: {field}
'
}
}
module
.
exports
=
{
module
.
exports
=
{
...
...
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lang/zh-hans.js
浏览文件 @
34cbebfd
...
@@ -45,7 +45,8 @@ const sentence = {
...
@@ -45,7 +45,8 @@ const sentence = {
'
uni-id-unbind-mobile-not-exists
'
:
'
这是当前唯一登录方式,请绑定手机号后再尝试解绑
'
,
'
uni-id-unbind-mobile-not-exists
'
:
'
这是当前唯一登录方式,请绑定手机号后再尝试解绑
'
,
'
uni-id-unbind-password-not-exists
'
:
'
请先设置密码在尝试解绑
'
,
'
uni-id-unbind-password-not-exists
'
:
'
请先设置密码在尝试解绑
'
,
'
uni-id-unsupported-request
'
:
'
不支持的请求方式
'
,
'
uni-id-unsupported-request
'
:
'
不支持的请求方式
'
,
'
uni-id-illegal-request
'
:
'
非法请求
'
'
uni-id-illegal-request
'
:
'
非法请求
'
,
'
uni-id-config-field-required
'
:
'
缺少配置项: {field}
'
}
}
module
.
exports
=
{
module
.
exports
=
{
...
...
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/verify-request-sign.js
浏览文件 @
34cbebfd
...
@@ -20,6 +20,15 @@ module.exports = function () {
...
@@ -20,6 +20,15 @@ module.exports = function () {
}
}
}
}
if
(
!
this
.
config
.
requestAuthSecret
||
typeof
this
.
config
.
requestAuthSecret
!==
'
string
'
)
{
throw
{
errCode
:
ERROR
.
CONFIG_FIELD_REQUIRED
,
errMsgVal
:
{
field
:
'
requestAuthSecret
'
}
}
}
const
timeout
=
20
*
1000
// 请求超过20秒不能再请求,防止重放攻击
const
timeout
=
20
*
1000
// 请求超过20秒不能再请求,防止重放攻击
const
{
headers
,
body
:
_body
}
=
this
.
getHttpInfo
()
const
{
headers
,
body
:
_body
}
=
this
.
getHttpInfo
()
const
{
'
uni-id-nonce
'
:
nonce
,
'
uni-id-timestamp
'
:
timestamp
,
'
uni-id-signature
'
:
signature
}
=
headers
const
{
'
uni-id-nonce
'
:
nonce
,
'
uni-id-timestamp
'
:
timestamp
,
'
uni-id-signature
'
:
signature
}
=
headers
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录