From bbf87b010694c67bf6a126a4510e24d839a625ab Mon Sep 17 00:00:00 2001 From: heminjian502 Date: Thu, 11 Aug 2022 18:00:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BB=E7=94=9F=E5=BE=AE=E4=BF=A1=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/web/controller/system/SysLoginController.java | 1 + .../java/com/ruoyi/system/service/impl/UserTokenService.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java index 72e2c59..9a7e521 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java @@ -73,6 +73,7 @@ public class SysLoginController @ApiOperation("app医生登录") @PostMapping("/login/app") public AjaxResult loginForApp(@RequestBody LoginBody loginBody) { + logger.info("login for app :{}", loginBody.getUsername()); if (!"123456".equals(loginBody.getPassword())) { return AjaxResult.error("密码错误"); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserTokenService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserTokenService.java index 8943ba9..e885d4f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserTokenService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserTokenService.java @@ -12,6 +12,8 @@ import eu.bitwalker.useragentutils.UserAgent; import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @@ -29,6 +31,7 @@ import java.util.concurrent.TimeUnit; @Component public class UserTokenService { + private static final Logger logger = LoggerFactory.getLogger(UserTokenService.class); // 令牌自定义标识 @Value("${token.header}") private String header; @@ -169,6 +172,7 @@ public class UserTokenService loginUser.setExpireTime(loginUser.getLoginTime() + appExpireTime * MILLIS_MINUTE); // 根据uuid将loginUser缓存 String userKey = getTokenKey(loginUser.getToken()); + logger.info("login user :{} , login user key :{}", loginUser.getUsername(), userKey); redisCache.setCacheObject(userKey, loginUser, appExpireTime, TimeUnit.MINUTES); }