mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-11-05 08:57:12 +08:00
新增:新增系统监控/在线用户功能,并优化部分注释规范
This commit is contained in:
@@ -169,7 +169,20 @@ public class GlobalExceptionHandler {
|
||||
@ExceptionHandler(NotLoginException.class)
|
||||
public R handleNotLoginException(NotLoginException e, HttpServletRequest request) {
|
||||
log.error("请求地址'{}',认证失败,无法访问系统资源", request.getRequestURI(), e);
|
||||
String errorMsg = "登录状态已过期,请重新登录";
|
||||
|
||||
String errorMsg;
|
||||
switch (e.getType()) {
|
||||
case NotLoginException.KICK_OUT:
|
||||
errorMsg = "您已被踢下线";
|
||||
break;
|
||||
case NotLoginException.BE_REPLACED_MESSAGE:
|
||||
errorMsg = "您已被顶下线";
|
||||
break;
|
||||
default:
|
||||
errorMsg = "登录状态已过期,请重新登录";
|
||||
break;
|
||||
}
|
||||
|
||||
LogContextHolder.setErrorMsg(errorMsg);
|
||||
return R.fail(HttpStatus.UNAUTHORIZED.value(), errorMsg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user