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
f30aa02a
Commit
f30aa02a
authored
Mar 09, 2020
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
32a02e25
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
94 additions
and
84 deletions
+94
-84
OpenInterceptor.java
...va/com/egolm/shop/common/interceptor/OpenInterceptor.java
+94
-84
No files found.
src/main/java/com/egolm/shop/common/interceptor/OpenInterceptor.java
View file @
f30aa02a
...
@@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletResponse;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
...
@@ -18,6 +19,7 @@ import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
...
@@ -18,6 +19,7 @@ import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import
com.egolm.common.GsonUtil
;
import
com.egolm.common.GsonUtil
;
import
com.egolm.common.MD5Util
;
import
com.egolm.common.MD5Util
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.Util
;
import
com.egolm.shop.common.XException
;
import
com.egolm.shop.common.XException
;
import
com.egolm.shop.common.utils.I18NUtils
;
import
com.egolm.shop.common.utils.I18NUtils
;
import
com.egolm.shop.common.utils.ShopContstrant
;
import
com.egolm.shop.common.utils.ShopContstrant
;
...
@@ -27,6 +29,9 @@ public class OpenInterceptor extends HandlerInterceptorAdapter {
...
@@ -27,6 +29,9 @@ public class OpenInterceptor extends HandlerInterceptorAdapter {
Log
logger
=
LogFactory
.
getLog
(
OpenInterceptor
.
class
);
Log
logger
=
LogFactory
.
getLog
(
OpenInterceptor
.
class
);
String
encoding
=
"UTF-8"
;
String
encoding
=
"UTF-8"
;
@Value
(
"${ignoreTimestamp:false}"
)
private
Boolean
ignoreTimestamp
;
@Autowired
@Autowired
private
RedisTemplate
<
String
,
Object
>
redisTemplate
;
private
RedisTemplate
<
String
,
Object
>
redisTemplate
;
...
@@ -46,6 +51,11 @@ public class OpenInterceptor extends HandlerInterceptorAdapter {
...
@@ -46,6 +51,11 @@ 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
))
{
throw
new
XException
(
"时间戳无效"
);
}
SortedMap
<
Object
,
Object
>
parameters
=
new
TreeMap
<
Object
,
Object
>();
SortedMap
<
Object
,
Object
>
parameters
=
new
TreeMap
<
Object
,
Object
>();
Set
<
String
>
keys
=
paramMap
.
keySet
()
;
Set
<
String
>
keys
=
paramMap
.
keySet
()
;
for
(
String
key
:
keys
)
{
for
(
String
key
:
keys
)
{
...
...
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