Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 28dcde56
authored
Dec 05, 2023
by
huangjinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:ak与token鉴权并行
1 parent
581d8865
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
18 deletions
project-gateway/src/main/java/com/dituhui/pea/gateway/config/AuthFilter.java
project-gateway/src/main/java/com/dituhui/pea/gateway/config/AuthFilter.java
View file @
28dcde5
...
@@ -84,25 +84,23 @@ public class AuthFilter implements GlobalFilter, Ordered {
...
@@ -84,25 +84,23 @@ public class AuthFilter implements GlobalFilter, Ordered {
}
}
// ak登录处理
// ak登录处理
if
(
StringUtils
.
isEmpty
(
authToken
))
{
final
String
ak
=
getParams
(
exchange
,
"ak"
,
headers
);
final
String
ak
=
getParams
(
exchange
,
"ak"
,
headers
);
if
(
log
.
isTraceEnabled
())
{
if
(
log
.
isTraceEnabled
())
{
log
.
trace
(
"ak is {}"
,
ak
);
log
.
trace
(
"ak is {}"
,
ak
);
}
}
if
(
StringUtils
.
isNotEmpty
(
ak
))
{
if
(
StringUtils
.
isNotEmpty
(
ak
))
{
// 验证ak,设置userDTO
// 验证ak,设置userDTO
// 验证成功,设置为管理员
// 验证成功,设置为管理员
// AppDTO appDTO = gson.fromJson(value, AppDTO.class);
// AppDTO appDTO = gson.fromJson(value, AppDTO.class);
// String secret = appDTO.getSecret();
// String secret = appDTO.getSecret();
Optional
<
Boolean
>
aBoolean
=
appKey
(
ak
);
Optional
<
Boolean
>
aBoolean
=
appKey
(
ak
);
if
(
aBoolean
.
isPresent
()
&&
Objects
.
equals
(
Boolean
.
TRUE
,
aBoolean
.
get
()))
{
if
(
aBoolean
.
isPresent
()
&&
Objects
.
equals
(
Boolean
.
TRUE
,
aBoolean
.
get
()))
{
final
String
sign
=
getParams
(
exchange
,
"sign"
,
headers
);
final
String
sign
=
getParams
(
exchange
,
"sign"
,
headers
);
//计算签名
//计算签名
//TODO 参数签名校验
//TODO 参数签名校验
userDTO
=
new
UserLoginDTO
();
userDTO
=
new
UserLoginDTO
();
userDTO
.
setId
(
Globals
.
SUPER_ADMIN_ID
);
userDTO
.
setId
(
Globals
.
SUPER_ADMIN_ID
);
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment