|
|
@@ -32,7 +32,7 @@ public class GlobalExceptionHandler {
|
|
|
public AjaxResult handlePreAuthorizeException(PreAuthorizeException e, HttpServletRequest request) {
|
|
|
String requestURI = request.getRequestURI();
|
|
|
log.error("请求地址'{}',权限校验失败'{}'", requestURI, e.getMessage());
|
|
|
- return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员");
|
|
|
+ return AjaxResult.error(HttpStatus.FORBIDDEN, "无操作权限,请联系管理员");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -63,7 +63,7 @@ public class GlobalExceptionHandler {
|
|
|
public AjaxResult handleDuplicateKeyException(DuplicateKeyException e, HttpServletRequest request) {
|
|
|
String requestURI = request.getRequestURI();
|
|
|
log.error("请求地址'{}',发生主键重复异常.", requestURI, e);
|
|
|
- return AjaxResult.error("存在重复数据,操作失败!");
|
|
|
+ return AjaxResult.error("数据重复,请修改后再操作!");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -73,7 +73,10 @@ public class GlobalExceptionHandler {
|
|
|
public AjaxResult handleRuntimeException(RuntimeException e, HttpServletRequest request) {
|
|
|
String requestURI = request.getRequestURI();
|
|
|
log.error("请求地址'{}',发生未知异常.", requestURI, e);
|
|
|
- return AjaxResult.error(e.getMessage());
|
|
|
+ if (e.getCause() != null) {
|
|
|
+ return AjaxResult.error(e.getCause().toString());
|
|
|
+ }
|
|
|
+ return AjaxResult.error(e.toString());
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -112,7 +115,7 @@ public class GlobalExceptionHandler {
|
|
|
@ExceptionHandler(RedisSystemException.class)
|
|
|
public Object handleRedisSystemException(RedisSystemException e) {
|
|
|
log.error(e.getMessage(), e);
|
|
|
- return AjaxResult.error("正在重新连接...请重试!");
|
|
|
+ return AjaxResult.error("正在重新连接,请再次尝试!");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -122,7 +125,7 @@ public class GlobalExceptionHandler {
|
|
|
public Object MaxUploadSizeExceededExceptionHandler(MaxUploadSizeExceededException e) {
|
|
|
log.error("MaxUploadSizeExceededException: "+ e);
|
|
|
e.printStackTrace();
|
|
|
- return AjaxResult.error("上传文件太大!");
|
|
|
+ return AjaxResult.error("上传文件过大,请压缩后再试!");
|
|
|
}
|
|
|
|
|
|
/**
|