From 81fba06d0ad7ec4dd93a7a5bb2fdc71de9895006 Mon Sep 17 00:00:00 2001 From: click33 <2393584716@qq.com> Date: Fri, 9 Jun 2023 13:56:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=8F=82=E6=95=B0=E5=90=8D?= =?UTF-8?q?=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 2 +- .../main/java/cn/dev33/satoken/temp/jwt/SaJwtUtil.java | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sa-token-demo/sa-token-demo-sso/sa-token-demo-sso3-client/src/main/resources/application.yml b/sa-token-demo/sa-token-demo-sso/sa-token-demo-sso3-client/src/main/resources/application.yml index a61bc655..931f2519 100644 --- a/sa-token-demo/sa-token-demo-sso/sa-token-demo-sso3-client/src/main/resources/application.yml +++ b/sa-token-demo/sa-token-demo-sso/sa-token-demo-sso3-client/src/main/resources/application.yml @@ -5,7 +5,7 @@ server: # sa-token配置 sa-token: # SSO-相关配置 - sso: + sso: # SSO-Server端 统一认证地址 auth-url: http://sa-sso-server.com:9000/sso/auth # 使用 Http 请求校验ticket (模式三) diff --git a/sa-token-plugin/sa-token-temp-jwt/src/main/java/cn/dev33/satoken/temp/jwt/SaJwtUtil.java b/sa-token-plugin/sa-token-temp-jwt/src/main/java/cn/dev33/satoken/temp/jwt/SaJwtUtil.java index 93e6aa7e..88dac617 100644 --- a/sa-token-plugin/sa-token-temp-jwt/src/main/java/cn/dev33/satoken/temp/jwt/SaJwtUtil.java +++ b/sa-token-plugin/sa-token-temp-jwt/src/main/java/cn/dev33/satoken/temp/jwt/SaJwtUtil.java @@ -108,17 +108,18 @@ public class SaJwtUtil { } /** - * 从一个 jwt-token 解析出载荷, 并取出其剩余有效期 + * 从一个 jwt-token 解析出载荷, 并取出其剩余有效期 + * @param service 指定的服务类型 * @param jwtToken JwtToken值 * @param keyt 秘钥 * @return 值 */ - public static long getTimeout(String key, String jwtToken, String keyt) { + public static long getTimeout(String service, String jwtToken, String keyt) { // 取出数据 Claims claims = parseToken(jwtToken, keyt); - // 如果给定的 key 不对 - if(claims.get(KEY_VALUE + key) == null) { + // 如果给定的 service 不对 + if(claims.get(KEY_VALUE + service) == null) { return SaTokenDao.NOT_VALUE_EXPIRE; }