mirror of https://gitee.com/stylefeng/guns
【7.2.3】更新devops url放开权限过滤
parent
6fc917e8e9
commit
d3efba5db8
|
@ -30,17 +30,19 @@ public class CustomErrorAttributes extends DefaultErrorAttributes {
|
||||||
Throwable throwable = this.getError(webRequest);
|
Throwable throwable = this.getError(webRequest);
|
||||||
if (throwable instanceof ServiceException) {
|
if (throwable instanceof ServiceException) {
|
||||||
ServiceException serviceException = (ServiceException) throwable;
|
ServiceException serviceException = (ServiceException) throwable;
|
||||||
return BeanUtil.beanToMap(new ErrorResponseData(serviceException.getErrorCode(), serviceException.getUserTip()));
|
return BeanUtil.beanToMap(new ErrorResponseData<>(serviceException.getErrorCode(), serviceException.getUserTip()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3.如果返回的是404 http状态码
|
// 3.如果返回的是404 http状态码
|
||||||
Integer status = (Integer) defaultErrorAttributes.get("status");
|
Integer status = (Integer) defaultErrorAttributes.get("status");
|
||||||
if (status.equals(HttpStatus.HTTP_NOT_FOUND)) {
|
if (status.equals(HttpStatus.HTTP_NOT_FOUND)) {
|
||||||
return BeanUtil.beanToMap(new ErrorResponseData(ValidatorExceptionEnum.NOT_FOUND.getErrorCode(), ValidatorExceptionEnum.NOT_FOUND.getUserTip()));
|
Map<String, Object> customAttrs = BeanUtil.beanToMap(new ErrorResponseData<>(ValidatorExceptionEnum.NOT_FOUND.getErrorCode(), ValidatorExceptionEnum.NOT_FOUND.getUserTip()));
|
||||||
|
customAttrs.putAll(defaultErrorAttributes);
|
||||||
|
return customAttrs;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4.无法确定的返回服务器异常
|
// 4.无法确定的返回服务器异常
|
||||||
return BeanUtil.beanToMap(new ErrorResponseData(DefaultBusinessExceptionEnum.SYSTEM_RUNTIME_ERROR.getErrorCode(), DefaultBusinessExceptionEnum.SYSTEM_RUNTIME_ERROR.getUserTip()));
|
return BeanUtil.beanToMap(new ErrorResponseData<>(DefaultBusinessExceptionEnum.SYSTEM_RUNTIME_ERROR.getErrorCode(), DefaultBusinessExceptionEnum.SYSTEM_RUNTIME_ERROR.getUserTip()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
UPDATE `sys_config` SET `config_value` = concat(config_value, '/guns-devops/**,') WHERE `config_code` = 'SYS_NONE_SECURITY_URLS';
|
Loading…
Reference in New Issue