Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello_uni-id-pages
提交
018987c8
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看板
提交
018987c8
编写于
3月 24, 2023
作者:
C
chenruilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(uni-id-co): 请求鉴权支持 uni-cloud-s2s
上级
6d4ffa9f
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
32 addition
and
4 deletion
+32
-4
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/error.js
...d-pages/uniCloud/cloudfunctions/uni-id-co/common/error.js
+1
-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
+27
-0
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json
...i-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json
+4
-3
未找到文件。
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/error.js
浏览文件 @
018987c8
...
...
@@ -40,7 +40,7 @@ const ERROR = {
UNSUPPORTED_REQUEST
:
'
uni-id-unsupported-request
'
,
ILLEGAL_REQUEST
:
'
uni-id-illegal-request
'
,
CONFIG_FIELD_REQUIRED
:
'
uni-id-config-field-required
'
,
CONFIG_FIELD_INVALID
:
'
uni-
frv
-config-field-invalid
'
,
CONFIG_FIELD_INVALID
:
'
uni-
id
-config-field-invalid
'
,
FRV_FAIL
:
'
uni-id-frv-fail
'
,
FRV_PROCESSING
:
'
uni-id-frv-processing
'
,
REAL_NAME_VERIFIED
:
'
uni-id-realname-verified
'
,
...
...
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/verify-request-sign.js
浏览文件 @
018987c8
const
crypto
=
require
(
'
crypto
'
)
const
createConfig
=
require
(
'
uni-config-center
'
)
const
{
verifyHttpInfo
}
=
require
(
'
uni-cloud-s2s
'
)
const
{
ERROR
}
=
require
(
'
../common/error
'
)
const
s2sConfig
=
createConfig
({
pluginId
:
'
uni-cloud-s2s
'
})
const
needSignFunctions
=
new
Set
([
'
externalRegister
'
,
'
externalLogin
'
,
...
...
@@ -20,6 +26,27 @@ module.exports = function () {
}
}
// 支持 uni-cloud-s2s 验证请求
if
(
s2sConfig
.
hasFile
(
'
config.json
'
))
{
try
{
if
(
!
verifyHttpInfo
(
this
.
getHttpInfo
()))
{
throw
{
errCode
:
ERROR
.
ILLEGAL_REQUEST
}
}
}
catch
(
e
)
{
if
(
e
.
errSubject
===
'
uni-cloud-s2s
'
)
{
throw
{
errCode
:
ERROR
.
ILLEGAL_REQUEST
,
errMsg
:
e
.
errMsg
}
}
throw
e
}
return
}
if
(
!
this
.
config
.
requestAuthSecret
||
typeof
this
.
config
.
requestAuthSecret
!==
'
string
'
)
{
throw
{
errCode
:
ERROR
.
CONFIG_FIELD_REQUIRED
,
...
...
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json
浏览文件 @
018987c8
{
"name"
:
"uni-id-co"
,
"version"
:
"1.1.
8
"
,
"version"
:
"1.1.
9
"
,
"description"
:
""
,
"main"
:
"index.js"
,
"keywords"
:
[],
...
...
@@ -11,11 +11,12 @@
"uni-captcha"
:
"file:../../../../uni-captcha/uniCloud/cloudfunctions/common/uni-captcha"
,
"uni-config-center"
:
"file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
,
"uni-id-common"
:
"file:../../../../uni-id-common/uniCloud/cloudfunctions/common/uni-id-common"
,
"uni-open-bridge-common"
:
"file:../../../../uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common"
"uni-open-bridge-common"
:
"file:../../../../uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common"
,
"uni-cloud-s2s"
:
"file:../../../../uni-cloud-s2s/uniCloud/cloudfunctions/common/uni-cloud-s2s"
},
"extensions"
:
{
"uni-cloud-sms"
:
{},
"uni-cloud-redis"
:
{},
"uni-cloud-sms"
:
{},
"uni-cloud-verify"
:
{}
},
"cloudfunction-config"
:
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录