|
@@ -113,7 +113,7 @@ public class LoginController {
|
|
|
|
|
|
// 保存操作日志
|
|
|
saveLog(userId);
|
|
|
- String loginKey = configConstant.redisPrefix + TypeCode.LOGIN_USER_KEY + userId;
|
|
|
+ String loginKey = configConstant.redisPrefix + TypeCode.LOGIN_USER_KEY + userId + ":" + token;
|
|
|
redisUtil.setEx(loginKey, token, 23, TimeUnit.HOURS);
|
|
|
|
|
|
|
|
@@ -132,16 +132,30 @@ public class LoginController {
|
|
|
return Result.success();
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "检查登录状态", notes = "true:已登录, false:已退出")
|
|
|
- @GetMapping("/admin/checkLogin")
|
|
|
- public Result checkLogin() {
|
|
|
- String token = request.getHeader("token");
|
|
|
- if (StrUtil.isBlank(token)) {
|
|
|
- log.info("token is null");
|
|
|
- }
|
|
|
- String o = (String) redisUtil.get(configConstant.redisPrefix + token);
|
|
|
- return Result.success(o != null);
|
|
|
- }
|
|
|
+// @ApiOperation(value = "检查登录状态", notes = "true:已登录, false:已退出")
|
|
|
+// @GetMapping("/admin/checkLogin")
|
|
|
+// public Result checkLogin() {
|
|
|
+// String token = request.getHeader("token");
|
|
|
+// if (StrUtil.isBlank(token)) {
|
|
|
+// log.info("token is null");
|
|
|
+// }
|
|
|
+// String o = (String) redisUtil.get(configConstant.redisPrefix + token);
|
|
|
+// return Result.success(o != null);
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+// @ApiOperation(value = "删除redis")
|
|
|
+// @GetMapping("/admin/redis")
|
|
|
+// public Result redis() {
|
|
|
+// String token = request.getHeader("token");
|
|
|
+// if (StrUtil.isBlank(token)) {
|
|
|
+// log.info("token is null");
|
|
|
+// }
|
|
|
+// Long userId = JwtUtil.getUserId(token);
|
|
|
+// String loginKey = configConstant.redisPrefix + TypeCode.LOGIN_USER_KEY + userId;
|
|
|
+// redisUtil.deleteAll(loginKey);
|
|
|
+// return Result.success();
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|