Commit 5982e45b by stylefeng

修改生成token的方法,删掉没用的参数

parent 264889f5
...@@ -73,8 +73,8 @@ public class JwtTokenUtil { ...@@ -73,8 +73,8 @@ public class JwtTokenUtil {
/** /**
* 获取md5 key从token中 * 获取md5 key从token中
*/ */
public String getMd5KeyFromToken(String token){ public String getMd5KeyFromToken(String token) {
return getPrivateClaimFromToken(token,jwtProperties.getMd5Key()); return getPrivateClaimFromToken(token, jwtProperties.getMd5Key());
} }
/** /**
...@@ -111,13 +111,13 @@ public class JwtTokenUtil { ...@@ -111,13 +111,13 @@ public class JwtTokenUtil {
public String generateToken(String userName, String randomKey) { public String generateToken(String userName, String randomKey) {
Map<String, Object> claims = new HashMap<>(); Map<String, Object> claims = new HashMap<>();
claims.put(jwtProperties.getMd5Key(), randomKey); claims.put(jwtProperties.getMd5Key(), randomKey);
return doGenerateToken(claims, userName, randomKey); return doGenerateToken(claims, userName);
} }
/** /**
* 生成token * 生成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 createdDate = new Date();
final Date expirationDate = new Date(createdDate.getTime() + jwtProperties.getExpiration() * 1000); final Date expirationDate = new Date(createdDate.getTime() + jwtProperties.getExpiration() * 1000);
......
...@@ -16,8 +16,7 @@ import com.stylefeng.guns.rest.modular.auth.converter.BaseTransferEntity; ...@@ -16,8 +16,7 @@ import com.stylefeng.guns.rest.modular.auth.converter.BaseTransferEntity;
public class JsonTest { public class JsonTest {
public static void main(String[] args) { public static void main(String[] args) {
String auth = "eyJhbGciOiJIUzUxMiJ9.eyJyYW5kb21LZXkiOiJmcnpubW0iLCJzdWIiOiJhZG1pbiIsImV4cCI6MTUwNDI1MzU4NSwiaWF0IjoxNTAzNjQ4Nzg1fQ.smQQlKnRgfHnfSkID6FoYpXBAMPw-NfFq4zaqc2E0Ve7V2nb0U5iIJvVMKY75lYbi1gYtDiTibqt0B39noNCHg"; String randomKey = "1xm7hw";
String randomKey = "nv0lwt";
BaseTransferEntity baseTransferEntity = new BaseTransferEntity(); BaseTransferEntity baseTransferEntity = new BaseTransferEntity();
SimpleObject simpleObject = new SimpleObject(); SimpleObject simpleObject = new SimpleObject();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment