Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
1a7b87de
Commit
1a7b87de
authored
Aug 25, 2017
by
stylefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注释完善
parent
5982e45b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
guns-rest/src/main/java/com/stylefeng/guns/rest/common/exception/BizExceptionEnum.java
+13
-2
guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/converter/WithSignMessageConverter.java
+2
-2
No files found.
guns-rest/src/main/java/com/stylefeng/guns/rest/common/exception/BizExceptionEnum.java
View file @
1a7b87de
...
...
@@ -8,10 +8,21 @@ package com.stylefeng.guns.rest.common.exception;
*/
public
enum
BizExceptionEnum
{
AUTH_REQUEST_ERROR
(
400
,
"账号密码错误"
),
/**
* token异常
*/
TOKEN_EXPIRED
(
700
,
"token过期"
),
TOKEN_ERROR
(
700
,
"token验证失败"
),
/**
* 签名异常
*/
SIGN_ERROR
(
700
,
"签名验证失败"
),
TOKEN_EXPIRED
(
700
,
"token过期"
);
/**
* 其他
*/
AUTH_REQUEST_ERROR
(
400
,
"账号密码错误"
);
BizExceptionEnum
(
int
code
,
String
message
)
{
this
.
friendlyCode
=
code
;
...
...
guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/converter/WithSignMessageConverter.java
View file @
1a7b87de
...
...
@@ -47,9 +47,9 @@ public class WithSignMessageConverter extends FastJsonHttpMessageConverter4 {
String
encrypt
=
MD5Util
.
encrypt
(
json
+
md5KeyFromToken
);
if
(
encrypt
.
equals
(
baseTransferEntity
.
getSign
()))
{
System
.
out
.
println
(
"签名校验成功"
);
System
.
out
.
println
(
"签名校验成功
!
"
);
}
else
{
System
.
out
.
println
(
"签名校验失败"
);
System
.
out
.
println
(
"签名校验失败
,数据被改动过!
"
);
throw
new
BussinessException
(
BizExceptionEnum
.
SIGN_ERROR
);
}
...
...
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