mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-11-22 00:46:48 +08:00
Compare commits
2 Commits
5f2c4205a5
...
78baf6497a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78baf6497a | ||
|
|
0719e53f01 |
2
pom.xml
2
pom.xml
@@ -27,7 +27,7 @@
|
|||||||
<mybatis-plus.version>3.5.14</mybatis-plus.version>
|
<mybatis-plus.version>3.5.14</mybatis-plus.version>
|
||||||
<p6spy.version>3.9.1</p6spy.version>
|
<p6spy.version>3.9.1</p6spy.version>
|
||||||
<hutool.version>5.8.40</hutool.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>
|
<redisson.version>3.51.0</redisson.version>
|
||||||
<lock4j.version>2.2.7</lock4j.version>
|
<lock4j.version>2.2.7</lock4j.version>
|
||||||
<dynamic-ds.version>4.3.1</dynamic-ds.version>
|
<dynamic-ds.version>4.3.1</dynamic-ds.version>
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import org.springframework.web.bind.MissingPathVariableException;
|
|||||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
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.method.annotation.MethodArgumentTypeMismatchException;
|
||||||
import org.springframework.web.servlet.NoHandlerFoundException;
|
import org.springframework.web.servlet.NoHandlerFoundException;
|
||||||
|
|
||||||
@@ -123,7 +124,7 @@ public class GlobalExceptionHandler {
|
|||||||
*/
|
*/
|
||||||
@ResponseStatus(org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR)
|
@ResponseStatus(org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR)
|
||||||
@ExceptionHandler(IOException.class)
|
@ExceptionHandler(IOException.class)
|
||||||
public void handleRuntimeException(IOException e, HttpServletRequest request) {
|
public void handleIoException(IOException e, HttpServletRequest request) {
|
||||||
String requestURI = request.getRequestURI();
|
String requestURI = request.getRequestURI();
|
||||||
if (requestURI.contains("sse")) {
|
if (requestURI.contains("sse")) {
|
||||||
// sse 经常性连接中断 例如关闭浏览器 直接屏蔽
|
// sse 经常性连接中断 例如关闭浏览器 直接屏蔽
|
||||||
@@ -132,6 +133,13 @@ public class GlobalExceptionHandler {
|
|||||||
log.error("请求地址'{}',连接中断", requestURI, e);
|
log.error("请求地址'{}',连接中断", requestURI, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sse 连接超时异常 不需要处理
|
||||||
|
*/
|
||||||
|
@ExceptionHandler(AsyncRequestTimeoutException.class)
|
||||||
|
public void handleRuntimeException(AsyncRequestTimeoutException e) {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拦截未知的运行时异常
|
* 拦截未知的运行时异常
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user