2 Commits

Author SHA1 Message Date
疯狂的狮子Li
78baf6497a update 优化 拦截sse超时异常 不需要额外处理 2025-09-29 13:35:10 +08:00
疯狂的狮子Li
0719e53f01 update springboot-admin 3.5.3 -> 3.5.5 修复登录白屏问题 2025-09-29 11:57:18 +08:00
2 changed files with 10 additions and 2 deletions

View File

@@ -27,7 +27,7 @@
<mybatis-plus.version>3.5.14</mybatis-plus.version>
<p6spy.version>3.9.1</p6spy.version>
<hutool.version>5.8.40</hutool.version>
<spring-boot-admin.version>3.5.3</spring-boot-admin.version>
<spring-boot-admin.version>3.5.5</spring-boot-admin.version>
<redisson.version>3.51.0</redisson.version>
<lock4j.version>2.2.7</lock4j.version>
<dynamic-ds.version>4.3.1</dynamic-ds.version>

View File

@@ -23,6 +23,7 @@ import org.springframework.web.bind.MissingPathVariableException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.context.request.async.AsyncRequestTimeoutException;
import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
import org.springframework.web.servlet.NoHandlerFoundException;
@@ -123,7 +124,7 @@ public class GlobalExceptionHandler {
*/
@ResponseStatus(org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR)
@ExceptionHandler(IOException.class)
public void handleRuntimeException(IOException e, HttpServletRequest request) {
public void handleIoException(IOException e, HttpServletRequest request) {
String requestURI = request.getRequestURI();
if (requestURI.contains("sse")) {
// sse 经常性连接中断 例如关闭浏览器 直接屏蔽
@@ -132,6 +133,13 @@ public class GlobalExceptionHandler {
log.error("请求地址'{}',连接中断", requestURI, e);
}
/**
* sse 连接超时异常 不需要处理
*/
@ExceptionHandler(AsyncRequestTimeoutException.class)
public void handleRuntimeException(AsyncRequestTimeoutException e) {
}
/**
* 拦截未知的运行时异常
*/