|
|
@@ -32,16 +32,7 @@ let MessageBox_401_show = false
|
|
|
|
|
|
// HTTP response 拦截器
|
|
|
axios.interceptors.response.use(
|
|
|
- (response) => {
|
|
|
- if (response.data.code == 400) {
|
|
|
- ElNotification.error({
|
|
|
- title: "请求错误",
|
|
|
- message: response.data.message || "Code:400,未知错误!"
|
|
|
- });
|
|
|
- return Promise.reject(response.data);
|
|
|
- }
|
|
|
- return response;
|
|
|
- },
|
|
|
+ (response) => response,
|
|
|
(error) => {
|
|
|
if (error.response) {
|
|
|
if (error.response.status == 404) {
|
|
|
@@ -54,6 +45,11 @@ axios.interceptors.response.use(
|
|
|
title: "请求错误",
|
|
|
message: error.response.data.message || "Status:500,服务器发生错误!"
|
|
|
});
|
|
|
+ } else if (error.response.status == 400) {
|
|
|
+ ElNotification.error({
|
|
|
+ title: "请求错误",
|
|
|
+ message: error.response.data || "Code:400,未知错误!"
|
|
|
+ });
|
|
|
} else if (error.response.status == 401) {
|
|
|
if (!MessageBox_401_show) {
|
|
|
MessageBox_401_show = true
|