|
@@ -1,5 +1,5 @@
|
|
|
import { extend } from "umi-request";
|
|
|
-import { showToast } from "vant";
|
|
|
+import { closeToast, showToast } from "vant";
|
|
|
import cleanDeep from "clean-deep";
|
|
|
import whiteUrl from "../constant/whiteUrl";
|
|
|
import { storeData } from "../store";
|
|
@@ -47,17 +47,18 @@ request.interceptors.response.use(
|
|
|
async (res, options) => {
|
|
|
console.log(options);
|
|
|
if (res.status > 299 || res.status < 200) {
|
|
|
- const msg = res.statusText + ", 状态码" + res.status;
|
|
|
- showToast(msg);
|
|
|
- throw new Error(msg);
|
|
|
- }
|
|
|
- const data = await res.clone().json();
|
|
|
- if (res.status > 299 || res.status < 200) {
|
|
|
// 判断是否有资源需要证书,不提示错误信息
|
|
|
if (res.status === 511) {
|
|
|
eventGlobal.emit('auth-not-installed');
|
|
|
+ closeToast()
|
|
|
+ } else {
|
|
|
+ const msg = res.statusText + ", 状态码" + res.status;
|
|
|
+ showToast(msg);
|
|
|
+ throw new Error(msg);
|
|
|
}
|
|
|
}
|
|
|
+ const data = await res.clone().json();
|
|
|
+
|
|
|
if (data.code === 5000) {
|
|
|
// 判断是否在应用中
|
|
|
window.parent.postMessage(
|