Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
7e082e52
Commit
7e082e52
authored
Apr 18, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加工作人员最后登录时间
parent
b065349b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
smart-gateway/src/main/java/com/mortals/xhx/base/framework/filter/AccessLogFilter.java
...om/mortals/xhx/base/framework/filter/AccessLogFilter.java
+5
-1
No files found.
smart-gateway/src/main/java/com/mortals/xhx/base/framework/filter/AccessLogFilter.java
View file @
7e082e52
...
...
@@ -166,10 +166,11 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
headers
.
putAll
(
exchange
.
getRequest
().
getHeaders
());
headers
.
remove
(
HttpHeaders
.
CONTENT_LENGTH
);
CachedBodyOutputMessage
outputMessage
=
new
CachedBodyOutputMessage
(
exchange
,
headers
);
log
.
info
(
"contentLens:"
+
HttpHeaders
.
CONTENT_LENGTH
);
return
bodyInserter
.
insert
(
outputMessage
,
new
BodyInserterContext
())
.
then
(
Mono
.
defer
(()
->
{
// 重新封装请求
log
.
info
(
"decoratedRequest 1"
);
ServerHttpRequest
decoratedRequest
=
requestDecorate
(
exchange
,
headers
,
outputMessage
);
// 记录响应日志
ServerHttpResponseDecorator
decoratedResponse
=
recordResponseLog
(
exchange
,
accessLogPdu
);
...
...
@@ -207,6 +208,7 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
@Override
public
HttpHeaders
getHeaders
()
{
long
contentLength
=
headers
.
getContentLength
();
log
.
info
(
"decoratedRequest contentLength:"
+
contentLength
);
HttpHeaders
httpHeaders
=
new
HttpHeaders
();
httpHeaders
.
putAll
(
super
.
getHeaders
());
if
(
contentLength
>
0
)
{
...
...
@@ -221,6 +223,8 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
@Override
public
Flux
<
DataBuffer
>
getBody
()
{
log
.
info
(
"outputMessage.getBody() contentLength:"
);
return
outputMessage
.
getBody
();
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment