fix static

This commit is contained in:
Looly 2021-07-29 13:29:15 +08:00
parent d4f16133de
commit 682429bc76
2 changed files with 4 additions and 3 deletions

View File

@ -9,6 +9,7 @@
* 【core 】 增加LookupFactory和MethodHandleUtilissue#I42TVY@Gitee * 【core 】 增加LookupFactory和MethodHandleUtilissue#I42TVY@Gitee
### 🐞Bug修复 ### 🐞Bug修复
* 【jwt 】 修复JWTUtil中几个方法非static的问题pr#386@Gitee
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------

View File

@ -69,7 +69,7 @@ public class JWTUtil {
* @param token token * @param token token
* @return {@link JWT} * @return {@link JWT}
*/ */
public JWT parseToken(String token) { public static JWT parseToken(String token) {
return JWT.of(token); return JWT.of(token);
} }
@ -80,7 +80,7 @@ public class JWTUtil {
* @param key HS256(HmacSHA256)密钥 * @param key HS256(HmacSHA256)密钥
* @return 是否有效 * @return 是否有效
*/ */
public boolean verify(String token, byte[] key) { public static boolean verify(String token, byte[] key) {
return JWT.of(token).setKey(key).verify(); return JWT.of(token).setKey(key).verify();
} }
@ -91,7 +91,7 @@ public class JWTUtil {
* @param signer 签名器 * @param signer 签名器
* @return 是否有效 * @return 是否有效
*/ */
public boolean verify(String token, JWTSigner signer) { public static boolean verify(String token, JWTSigner signer) {
return JWT.of(token).verify(signer); return JWT.of(token).verify(signer);
} }
} }