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