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
ac685eba
Commit
ac685eba
authored
Aug 19, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改网关日志
parent
7c79c79e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
6 deletions
+1
-6
smart-gateway/src/main/java/com/mortals/xhx/base/framework/filter/AccessLogFilter.java
...om/mortals/xhx/base/framework/filter/AccessLogFilter.java
+1
-6
No files found.
smart-gateway/src/main/java/com/mortals/xhx/base/framework/filter/AccessLogFilter.java
View file @
ac685eba
package
com.mortals.xhx.base.framework.filter
;
package
com.mortals.xhx.base.framework.filter
;
import
cn.hutool.core.net.NetUtil
;
import
cn.hutool.core.net.NetUtil
;
import
cn.hutool.core.util.IdUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.RandomUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.xhx.base.framework.service.MessageProducer
;
import
com.mortals.xhx.base.framework.service.MessageProducer
;
import
com.mortals.xhx.common.pdu.access.AccessLogPdu
;
import
com.mortals.xhx.common.pdu.access.AccessLogPdu
;
import
com.mortals.xhx.common.utils.IpUtils
;
import
com.mortals.xhx.common.utils.IpUtils
;
import
jodd.util.StringUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.reactivestreams.Publisher
;
import
org.reactivestreams.Publisher
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -40,7 +36,6 @@ import org.springframework.web.reactive.function.BodyInserters;
...
@@ -40,7 +36,6 @@ import org.springframework.web.reactive.function.BodyInserters;
import
org.springframework.web.reactive.function.server.HandlerStrategies
;
import
org.springframework.web.reactive.function.server.HandlerStrategies
;
import
org.springframework.web.reactive.function.server.ServerRequest
;
import
org.springframework.web.reactive.function.server.ServerRequest
;
import
org.springframework.web.server.ServerWebExchange
;
import
org.springframework.web.server.ServerWebExchange
;
import
org.springframework.web.util.WebUtils
;
import
reactor.core.publisher.Flux
;
import
reactor.core.publisher.Flux
;
import
reactor.core.publisher.Mono
;
import
reactor.core.publisher.Mono
;
...
@@ -269,7 +264,7 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
...
@@ -269,7 +264,7 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
// 获取响应类型,如果是 json 就打印
// 获取响应类型,如果是 json 就打印
String
originalResponseContentType
=
exchange
.
getAttribute
(
ServerWebExchangeUtils
.
ORIGINAL_RESPONSE_CONTENT_TYPE_ATTR
);
String
originalResponseContentType
=
exchange
.
getAttribute
(
ServerWebExchangeUtils
.
ORIGINAL_RESPONSE_CONTENT_TYPE_ATTR
);
if
(
ObjectUtil
.
equal
(
this
.
getStatusCode
(),
HttpStatus
.
OK
)
if
(
ObjectUtil
.
equal
(
this
.
getStatusCode
(),
HttpStatus
.
OK
)
&&
StringUtil
.
isNotBlank
(
originalResponseContentType
)
&&
StringUtil
s
.
isNotBlank
(
originalResponseContentType
)
&&
originalResponseContentType
.
contains
(
"application/json"
))
{
&&
originalResponseContentType
.
contains
(
"application/json"
))
{
Flux
<?
extends
DataBuffer
>
fluxBody
=
Flux
.
from
(
body
);
Flux
<?
extends
DataBuffer
>
fluxBody
=
Flux
.
from
(
body
);
...
...
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