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
5982e45b
Commit
5982e45b
authored
Aug 25, 2017
by
stylefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改生成token的方法,删掉没用的参数
parent
264889f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/util/JwtTokenUtil.java
+4
-4
guns-rest/src/test/java/com/stylefeng/guns/fastjson/JsonTest.java
+1
-2
No files found.
guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/util/JwtTokenUtil.java
View file @
5982e45b
...
...
@@ -73,8 +73,8 @@ public class JwtTokenUtil {
/**
* 获取md5 key从token中
*/
public
String
getMd5KeyFromToken
(
String
token
){
return
getPrivateClaimFromToken
(
token
,
jwtProperties
.
getMd5Key
());
public
String
getMd5KeyFromToken
(
String
token
)
{
return
getPrivateClaimFromToken
(
token
,
jwtProperties
.
getMd5Key
());
}
/**
...
...
@@ -111,13 +111,13 @@ public class JwtTokenUtil {
public
String
generateToken
(
String
userName
,
String
randomKey
)
{
Map
<
String
,
Object
>
claims
=
new
HashMap
<>();
claims
.
put
(
jwtProperties
.
getMd5Key
(),
randomKey
);
return
doGenerateToken
(
claims
,
userName
,
randomKey
);
return
doGenerateToken
(
claims
,
userName
);
}
/**
* 生成token
*/
private
String
doGenerateToken
(
Map
<
String
,
Object
>
claims
,
String
subject
,
String
randomKey
)
{
private
String
doGenerateToken
(
Map
<
String
,
Object
>
claims
,
String
subject
)
{
final
Date
createdDate
=
new
Date
();
final
Date
expirationDate
=
new
Date
(
createdDate
.
getTime
()
+
jwtProperties
.
getExpiration
()
*
1000
);
...
...
guns-rest/src/test/java/com/stylefeng/guns/fastjson/JsonTest.java
View file @
5982e45b
...
...
@@ -16,8 +16,7 @@ import com.stylefeng.guns.rest.modular.auth.converter.BaseTransferEntity;
public
class
JsonTest
{
public
static
void
main
(
String
[]
args
)
{
String
auth
=
"eyJhbGciOiJIUzUxMiJ9.eyJyYW5kb21LZXkiOiJmcnpubW0iLCJzdWIiOiJhZG1pbiIsImV4cCI6MTUwNDI1MzU4NSwiaWF0IjoxNTAzNjQ4Nzg1fQ.smQQlKnRgfHnfSkID6FoYpXBAMPw-NfFq4zaqc2E0Ve7V2nb0U5iIJvVMKY75lYbi1gYtDiTibqt0B39noNCHg"
;
String
randomKey
=
"nv0lwt"
;
String
randomKey
=
"1xm7hw"
;
BaseTransferEntity
baseTransferEntity
=
new
BaseTransferEntity
();
SimpleObject
simpleObject
=
new
SimpleObject
();
...
...
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