update websocket 链接限制变为同ip可以多个用户登录,单用户只能登录一个

This commit is contained in:
yyb
2025-04-24 16:10:39 +08:00
parent c596d9ab30
commit 889189e726
14 changed files with 86 additions and 49 deletions

View File

@@ -78,6 +78,7 @@ public class GlobalExceptionHandler {
@ExceptionHandler(ServiceException.class)
public AjaxResult handleServiceException(ServiceException e, HttpServletRequest request)
{
log.error(e.getMessage(), e);
Integer code = e.getCode();
return StringUtils.isNotNull(code) ? AjaxResult.error(code, e.getMessage()) : AjaxResult.error(e.getMessage());
@@ -89,9 +90,10 @@ public class GlobalExceptionHandler {
@ExceptionHandler(RuntimeException.class)
public AjaxResult handleRuntimeException(RuntimeException e, HttpServletRequest request)
{
System.out.println("异常抛出时间"+System.currentTimeMillis());
String requestURI = request.getRequestURI();
log.error("请求地址'{}',发生未知异常.", requestURI, e);
return AjaxResult.error(e.getMessage());
return AjaxResult.error(HttpStatus.BAD_REQUEST,e.getMessage());
}
/**