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
772268ce
Commit
772268ce
authored
Mar 13, 2024
by
张永
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
V1.1.7.5
parent
ff017898
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
9 deletions
+27
-9
pom.xml
pom.xml
+1
-1
WebMvcConfig.java
src/main/java/com/egolm/shop/common/config/WebMvcConfig.java
+8
-0
OpenInterceptor.java
...va/com/egolm/shop/common/interceptor/OpenInterceptor.java
+14
-8
application.properties
src/main/resources/application.properties
+2
-0
redmine.html
src/main/resources/templates/redmine.html
+2
-0
No files found.
pom.xml
View file @
772268ce
...
@@ -209,7 +209,7 @@
...
@@ -209,7 +209,7 @@
</executions>
</executions>
<configuration>
<configuration>
<repository>
dockerhub.linkfern.com/b2c/shopapi
</repository>
<repository>
dockerhub.linkfern.com/b2c/shopapi
</repository>
<tag>
V1.1.7.
4
</tag>
<tag>
V1.1.7.
5
</tag>
<buildArgs>
<buildArgs>
<JAR_FILE>
${project.build.finalName}.jar
</JAR_FILE>
<JAR_FILE>
${project.build.finalName}.jar
</JAR_FILE>
</buildArgs>
</buildArgs>
...
...
src/main/java/com/egolm/shop/common/config/WebMvcConfig.java
View file @
772268ce
package
com
.
egolm
.
shop
.
common
.
config
;
package
com
.
egolm
.
shop
.
common
.
config
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.InterceptorRegistration
;
import
org.springframework.web.servlet.config.annotation.InterceptorRegistration
;
...
@@ -12,6 +13,8 @@ import com.egolm.shop.common.interceptor.OpenInterceptor;
...
@@ -12,6 +13,8 @@ import com.egolm.shop.common.interceptor.OpenInterceptor;
@Configuration
@Configuration
public
class
WebMvcConfig
implements
WebMvcConfigurer
{
public
class
WebMvcConfig
implements
WebMvcConfigurer
{
@Value
(
"${server.isSign:false}"
)
private
boolean
isSign
;
@Autowired
@Autowired
OpenInterceptor
openInterceptor
;
OpenInterceptor
openInterceptor
;
...
@@ -45,6 +48,11 @@ public class WebMvcConfig implements WebMvcConfigurer {
...
@@ -45,6 +48,11 @@ public class WebMvcConfig implements WebMvcConfigurer {
InterceptorRegistration
logsRegistration
=
registry
.
addInterceptor
(
logInterceptor
).
addPathPatterns
(
"/**"
);
InterceptorRegistration
logsRegistration
=
registry
.
addInterceptor
(
logInterceptor
).
addPathPatterns
(
"/**"
);
logsRegistration
.
excludePathPatterns
(
"/"
,
"/**.*"
,
"/error"
);
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 @
772268ce
...
@@ -32,6 +32,9 @@ public class OpenInterceptor extends HandlerInterceptorAdapter {
...
@@ -32,6 +32,9 @@ public class OpenInterceptor extends HandlerInterceptorAdapter {
@Value
(
"${ignoreTimestamp:false}"
)
@Value
(
"${ignoreTimestamp:false}"
)
private
Boolean
ignoreTimestamp
;
private
Boolean
ignoreTimestamp
;
@Value
(
"${server.md5key:90f49d4bb0216c10816c7dec6bf28c89}"
)
private
String
defaultMd5Key
;
@Autowired
@Autowired
private
RedisTemplate
<
String
,
Object
>
redisTemplate
;
private
RedisTemplate
<
String
,
Object
>
redisTemplate
;
...
@@ -51,9 +54,10 @@ public class OpenInterceptor extends HandlerInterceptorAdapter {
...
@@ -51,9 +54,10 @@ public class OpenInterceptor extends HandlerInterceptorAdapter {
throw
new
XException
(
I18NUtils
.
getMessage
(
langID
,
"Msg_Paramter_Empty"
,
"[sign,timestamp,langID,terminal]"
))
;
throw
new
XException
(
I18NUtils
.
getMessage
(
langID
,
"Msg_Paramter_Empty"
,
"[sign,timestamp,langID,terminal]"
))
;
}
}
Long
timeLong
=
Util
.
objTo
(
timestamp
,
Long
.
class
,
0L
);
if
(!
ignoreTimestamp
&&
Math
.
abs
(
timeLong
-
System
.
currentTimeMillis
())
>
(
60L
*
5L
))
{
boolean
checkTimstamp
=
StringUtil
.
checkTimeStamp_13
(
5
,
timestamp
);
throw
new
XException
(
"时间戳无效"
);
if
(!
checkTimstamp
)
{
throw
new
XException
(
"时间戳错误或失效"
);
}
}
SortedMap
<
Object
,
Object
>
parameters
=
new
TreeMap
<
Object
,
Object
>();
SortedMap
<
Object
,
Object
>
parameters
=
new
TreeMap
<
Object
,
Object
>();
...
@@ -62,17 +66,19 @@ public class OpenInterceptor extends HandlerInterceptorAdapter {
...
@@ -62,17 +66,19 @@ public class OpenInterceptor extends HandlerInterceptorAdapter {
String
value
=
req
.
getParameter
(
key
);
String
value
=
req
.
getParameter
(
key
);
parameters
.
put
(
key
,
value
);
parameters
.
put
(
key
,
value
);
}
}
redisTemplate
.
opsForHash
().
put
(
"SystemCtl1111"
,
"test"
,
"111"
);
/*
redisTemplate.opsForHash().put("SystemCtl1111", "test","111");
System.out.println(redisTemplate.opsForHash().get("SystemCtl1111", "test"));
System.out.println(redisTemplate.opsForHash().get("SystemCtl1111", "test"));
Map<?, ?> map = (Map<?, ?>)redisTemplate.opsForHash().get(ShopContstrant.SystemCtl_Redis_Base_Key, ShopContstrant.CLIENT_MD5KEY);
Map<?, ?> map = (Map<?, ?>)redisTemplate.opsForHash().get(ShopContstrant.SystemCtl_Redis_Base_Key, ShopContstrant.CLIENT_MD5KEY);
System.out.println(map);
System.out.println(map);
if(map != null) {
if(map != null) {
parameters
.
put
(
"md5Key"
,
map
.
get
(
"sValue1"
)+
""
);
parameters.put("md5Key",
defaultMd5Key
);
}else {
}else {
logger.info("从redis中获取 计算签名用的md5key 获取失败");
logger.info("从redis中获取 计算签名用的md5key 获取失败");
throw new XException(I18NUtils.getMessage(langID, "Msg_Sign_failure"));
throw new XException(I18NUtils.getMessage(langID, "Msg_Sign_failure"));
}
} */
parameters
.
put
(
"md5Key"
,
defaultMd5Key
);
logger
.
info
(
"request sign >>>>>>"
+
sign
);
logger
.
info
(
"request sign >>>>>>"
+
sign
);
String
createSign
=
MD5Util
.
createSign
(
encoding
,
parameters
);
String
createSign
=
MD5Util
.
createSign
(
encoding
,
parameters
);
...
...
src/main/resources/application.properties
View file @
772268ce
...
@@ -7,6 +7,8 @@ server.session.timeout=90000
...
@@ -7,6 +7,8 @@ server.session.timeout=90000
server.tomcat.uri-encoding
=
utf-8
server.tomcat.uri-encoding
=
utf-8
server.shop.name
=
shop
server.shop.name
=
shop
server.isSign
=
true
server.md5key
=
90f49d4bb0216c10816c7dec6bf28c89
spring.http.multipart.maxFileSize
=
5MB
spring.http.multipart.maxFileSize
=
5MB
spring.http.multipart.maxRequestSize
=
5MB
spring.http.multipart.maxRequestSize
=
5MB
...
...
src/main/resources/templates/redmine.html
View file @
772268ce
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
</head>
</head>
<body>
<body>
<div
id=
"app"
>
<div
id=
"app"
>
<el-divider
content-position=
"left"
>
V1.1.7.5 2024-3-13
</el-divider>
<p
class=
"title"
>
1.增加接口签名验证及开关
</p>
<el-divider
content-position=
"left"
>
V1.1.7.4 2024-3-1
</el-divider>
<el-divider
content-position=
"left"
>
V1.1.7.4 2024-3-1
</el-divider>
<p
class=
"title"
>
1.将日志写入SqlServer LGODB的idcSystemLog,一月一表: idcSystemLog_yyyyMM
</p>
<p
class=
"title"
>
1.将日志写入SqlServer LGODB的idcSystemLog,一月一表: idcSystemLog_yyyyMM
</p>
<p
class=
"title"
>
2.读写分离拆分 需求 #16467
</p>
<p
class=
"title"
>
2.读写分离拆分 需求 #16467
</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