Merge branch 'dev' of https://github.com/fit2cloudrd/metersphere-server into dev
This commit is contained in:
commit
cb6291bcb0
|
@ -24,8 +24,7 @@ public class RestControllerExceptionHandler {
|
||||||
|
|
||||||
@ExceptionHandler(MSException.class)
|
@ExceptionHandler(MSException.class)
|
||||||
public ResultHolder msExceptionHandler(HttpServletRequest request, HttpServletResponse response, MSException e) {
|
public ResultHolder msExceptionHandler(HttpServletRequest request, HttpServletResponse response, MSException e) {
|
||||||
// 自定义异常返回200
|
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
|
||||||
response.setStatus(HttpStatus.OK.value());
|
|
||||||
return ResultHolder.error(e.getMessage());
|
return ResultHolder.error(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,8 +48,12 @@ export default {
|
||||||
function exception(error, result) {
|
function exception(error, result) {
|
||||||
result.loading = false;
|
result.loading = false;
|
||||||
window.console.error(error.response || error.message);
|
window.console.error(error.response || error.message);
|
||||||
|
if (error.response.data) {
|
||||||
|
Message.error({message: error.response.data.message, showClose: true});
|
||||||
|
} else {
|
||||||
Message.error({message: error.message, showClose: true});
|
Message.error({message: error.message, showClose: true});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Vue.prototype.$get = function (url, success) {
|
Vue.prototype.$get = function (url, success) {
|
||||||
let result = {loading: true};
|
let result = {loading: true};
|
||||||
|
|
Loading…
Reference in New Issue