Skip to content

Commit

Permalink
feat : a
Browse files Browse the repository at this point in the history
  • Loading branch information
qizhenxin committed Apr 12, 2024
1 parent dfc3a05 commit 7676285
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,24 +109,22 @@ public R<String> testLogin(@RequestParam("stuId") String stuId) {
User user = userService.lambdaQuery().eq(User::getId, 35).one();
return getStringR(sessionKey1, user);
} else if (stuId.equals(sessionKey2)) {
if (stuId.equals(sessionKey2)) {
User user = userService.lambdaQuery().eq(User::getId, 14).one();
return getStringR(sessionKey2, user);
}
User user = userService.lambdaQuery().eq(User::getId, 14).one();
return getStringR(sessionKey2, user);
}
return new R<>(ResultCode.SUCCESS, "");
}

private R<String> getStringR(String sessionKey2, User user) {
private R<String> getStringR(String sessionKey, User user) {
if (ObjectUtil.isNull(user)) {
return null;
}
user.setSessionKey(sessionKey2);
stringRedisTemplate.opsForValue().set(RedisConstant.LOGIN_PREFIX + sessionKey2,
user.setSessionKey(sessionKey);
stringRedisTemplate.opsForValue().set(RedisConstant.LOGIN_PREFIX + sessionKey,
JSONUtil.toJsonStr(user),
RedisConstant.LOGIN_VALID_TTL,
TimeUnit.DAYS);
return new R<>(ResultCode.SUCCESS, sessionKey2);
return new R<>(ResultCode.SUCCESS, sessionKey);
}

}

0 comments on commit 7676285

Please sign in to comment.