|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
import axios from "axios";
|
|
import axios from "axios";
|
|
import store from "@/store";
|
|
import store from "@/store";
|
|
|
|
+import router from "@/router";
|
|
import { getAllPromise } from "@/utils/tools";
|
|
import { getAllPromise } from "@/utils/tools";
|
|
import { objKeySort, dateChange } from "@/filters";
|
|
import { objKeySort, dateChange } from "@/filters";
|
|
import { Toast } from "vant";
|
|
import { Toast } from "vant";
|
|
@@ -106,6 +107,13 @@ _axios.interceptors.response.use(
|
|
Toast(message);
|
|
Toast(message);
|
|
return Promise.reject(error);
|
|
return Promise.reject(error);
|
|
}
|
|
}
|
|
|
|
+ if (status === 412) {
|
|
|
|
+ message = "登录过期,重新登录";
|
|
|
|
+ Toast(message);
|
|
|
|
+ router.push({ name: "home" });
|
|
|
|
+ window.location.reload();
|
|
|
|
+ return Promise.reject(error);
|
|
|
|
+ }
|
|
if (status < 200) {
|
|
if (status < 200) {
|
|
message = `未处理的消息响应,状态码:${status}`;
|
|
message = `未处理的消息响应,状态码:${status}`;
|
|
} else if (status >= 300 && status < 400) {
|
|
} else if (status >= 300 && status < 400) {
|