|
@@ -12,6 +12,7 @@ import org.dromara.common.core.exception.ServiceException;
|
|
|
import org.dromara.common.core.exception.SseException;
|
|
|
import org.dromara.common.core.exception.base.BaseException;
|
|
|
import org.dromara.common.core.utils.StreamUtils;
|
|
|
+import org.dromara.common.json.utils.JsonUtils;
|
|
|
import org.springframework.context.support.DefaultMessageSourceResolvable;
|
|
|
import org.springframework.validation.BindException;
|
|
|
import org.springframework.web.HttpRequestMethodNotSupportedException;
|
|
@@ -63,7 +64,7 @@ public class GlobalExceptionHandler {
|
|
|
public String handleNotLoginException(SseException e, HttpServletRequest request) {
|
|
|
String requestURI = request.getRequestURI();
|
|
|
log.error("请求地址'{}',认证失败'{}',无法访问系统资源", requestURI, e.getMessage());
|
|
|
- return e.getMessage();
|
|
|
+ return JsonUtils.toJsonString(R.fail(HttpStatus.HTTP_UNAUTHORIZED, "认证失败,无法访问系统资源"));
|
|
|
}
|
|
|
|
|
|
/**
|