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); }