Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
shop
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
shop
Commits
7a6468ce
Commit
7a6468ce
authored
May 27, 2024
by
张永
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
V1.1.7.6
parent
067224da
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
5 deletions
+18
-5
WebMvcConfig.java
src/main/java/com/egolm/shop/common/config/WebMvcConfig.java
+2
-2
OpenInterceptor.java
...va/com/egolm/shop/common/interceptor/OpenInterceptor.java
+11
-0
logback.xml
src/main/resources/logback.xml
+3
-2
redmine.html
src/main/resources/templates/redmine.html
+2
-1
No files found.
src/main/java/com/egolm/shop/common/config/WebMvcConfig.java
View file @
7a6468ce
...
...
@@ -45,9 +45,9 @@ public class WebMvcConfig implements WebMvcConfigurer {
@Override
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
InterceptorRegistration
logsRegistration
=
registry
.
addInterceptor
(
logInterceptor
).
addPathPatterns
(
"/**"
);
/*
InterceptorRegistration logsRegistration = registry.addInterceptor(logInterceptor).addPathPatterns("/**");
logsRegistration.excludePathPatterns("/", "/**.*", "/error");
logsRegistration
.
excludePathPatterns
(
"/csrf"
,
"/swagger-resources/**"
,
"/webjars/**"
);
logsRegistration.excludePathPatterns("/csrf", "/swagger-resources/**", "/webjars/**");
*/
if
(
isSign
)
{
registry
.
addInterceptor
(
openInterceptor
).
addPathPatterns
(
"/**"
).
excludePathPatterns
(
"/pay/**"
);
...
...
src/main/java/com/egolm/shop/common/interceptor/OpenInterceptor.java
View file @
7a6468ce
...
...
@@ -17,6 +17,7 @@ import org.springframework.stereotype.Component;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
import
com.egolm.common.GsonUtil
;
import
com.egolm.common.LogBackUtil
;
import
com.egolm.common.MD5Util
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.Util
;
...
...
@@ -43,6 +44,16 @@ public class OpenInterceptor extends HandlerInterceptorAdapter {
public
boolean
preHandle
(
HttpServletRequest
req
,
HttpServletResponse
resp
,
Object
handler
)
throws
Exception
{
String
uri
=
req
.
getRequestURI
();
if
((
uri
.
indexOf
(
"swagger"
)
==
-
1
&&
uri
.
indexOf
(
"/v2/api-docs"
)
==
-
1
)
)
{
//设置一个requetId
String
traceId
=
req
.
getHeader
(
LogBackUtil
.
TRACE_ID
);
if
(!
StringUtil
.
isNotBlank
(
traceId
))
{
traceId
=
StringUtil
.
getId
();
}
LogBackUtil
.
setTraceId
(
traceId
);
resp
.
setHeader
(
LogBackUtil
.
TRACE_ID
,
traceId
);
Map
<
String
,
String
[]>
paramMap
=
req
.
getParameterMap
();
logger
.
info
(
uri
);
logger
.
info
(
GsonUtil
.
toJson
(
paramMap
));
...
...
src/main/resources/logback.xml
View file @
7a6468ce
...
...
@@ -6,7 +6,7 @@
<!-- Console 输出设置 -->
<appender
name=
"console"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<pattern>
%d{MM-dd HH:mm:ss.SSS}
%-5level [%logger{50}] - %msg%n
</pattern>
<pattern>
%date [trace_id=%X{trace_id}]
%-5level [%logger{50}] - %msg%n
</pattern>
<charset>
utf8
</charset>
</encoder>
</appender>
...
...
@@ -17,7 +17,8 @@
<MaxHistory>
30
</MaxHistory>
</rollingPolicy>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<pattern>
${CONSOLE_LOG_PATTERN}
</pattern>
<pattern>
%date [trace_id=%X{trace_id}] %-5level [%logger{50}] %file:%line - %msg%n
</pattern>
</encoder>
</appender>
...
...
src/main/resources/templates/redmine.html
View file @
7a6468ce
...
...
@@ -24,9 +24,10 @@
</head>
<body>
<div
id=
"app"
>
<el-divider
content-position=
"left"
>
V1.1.7.6 2024-5-2
2
</el-divider>
<el-divider
content-position=
"left"
>
V1.1.7.6 2024-5-2
7
</el-divider>
<p
class=
"title"
>
1.支付回调失败状态为99的,刚写文件,需求 #16796
</p>
<p
class=
"title"
>
2.改取IP方法,需求 #16869
</p>
<p
class=
"title"
>
3.日志增加trace_id
</p>
<el-divider
content-position=
"left"
>
V1.1.7.5 2024-4-23
</el-divider>
<p
class=
"title"
>
1.增加接口签名验证及开关
</p>
<p
class=
"title"
>
2.需求 #16555、需求 #16563 需求 #16542,需求 #16595
</p>
...
...
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