mirror of https://gitee.com/stylefeng/guns
修改生成token的方法,删掉没用的参数
parent
264889f5f9
commit
5982e45b1f
|
@ -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);
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue