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
c7b6ede8
Commit
c7b6ede8
authored
Sep 17, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
5ff10c80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
OpenInterceptor.java
...va/com/egolm/shop/config/interceptor/OpenInterceptor.java
+3
-1
No files found.
src/main/java/com/egolm/shop/config/interceptor/OpenInterceptor.java
View file @
c7b6ede8
...
...
@@ -11,10 +11,11 @@ import javax.servlet.http.HttpServletResponse;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
import
com.alibaba.fastjson.JSON
;
import
com.egolm.common.GsonUtil
;
import
com.egolm.common.MD5Util
;
import
com.egolm.common.StringUtil
;
...
...
@@ -33,6 +34,7 @@ public class OpenInterceptor extends HandlerInterceptorAdapter {
/*签名规则:1.按照参数字段名ASCII码排序;2.参数进行url拼接;3.加上签名字符串secret;4.得到字符串后进行SHA1签名;5.将签名得到的字符串加入参数列表中,字段名为sig*/
@Override
public
boolean
preHandle
(
HttpServletRequest
req
,
HttpServletResponse
resp
,
Object
handler
)
throws
Exception
{
logger
.
debug
(
JSON
.
toJSONString
(
req
.
getParameterMap
()));
String
uri
=
req
.
getRequestURI
();
if
((
uri
.
indexOf
(
"swagger"
)
==
-
1
&&
uri
.
indexOf
(
"/v2/api-docs"
)
==
-
1
)
)
{
Map
<
String
,
String
[]>
paramMap
=
req
.
getParameterMap
();
...
...
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