From aa5f221a90e8fde79b6b634c8b5599398b2db0bf Mon Sep 17 00:00:00 2001 From: "zhiyong.ning" <354350178@qq.com> Date: Thu, 18 Mar 2021 15:00:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yipin/liuwanr/service/UserInfoService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/yipin/liuwanr/service/UserInfoService.java b/src/main/java/com/yipin/liuwanr/service/UserInfoService.java index 214c5b9..a774325 100644 --- a/src/main/java/com/yipin/liuwanr/service/UserInfoService.java +++ b/src/main/java/com/yipin/liuwanr/service/UserInfoService.java @@ -482,7 +482,6 @@ public class UserInfoService { user.setSchoolId(schoolId); } } - if (user==null){ resp.put("retvalue","账号密码有误,请稍后再试!"); resp.put("retcode", 300); @@ -492,7 +491,10 @@ public class UserInfoService { user.setLastLoginTime(lastLoginTime); //登录成功,重新设置最后登录时间以及登录次数 userInfoMapper.updateLogInNumber(user); - + String token = user.getToken(); + ValueOperations redis = stringRedisTemplate.opsForValue(); + redis.set(token,lastLoginTime, 30 * 60, TimeUnit.SECONDS); + user.setDataTime(lastLoginTime); resp.put("retvalue",user); resp.put("retcode", 200); }