|
@@ -33,8 +33,11 @@ Vue.prototype.GLOBAL = GLOBAL;
|
|
Vue.config.productionTip = false;
|
|
Vue.config.productionTip = false;
|
|
|
|
|
|
// logger
|
|
// logger
|
|
-const addLog = (datas, type = "success") => {
|
|
|
|
- if (type === "success") {
|
|
|
|
|
|
+const addLog = (datas, type) => {
|
|
|
|
+ if (type === "start") {
|
|
|
|
+ const msg = `${datas.url},开始请求`;
|
|
|
|
+ logger.info(msg);
|
|
|
|
+ } else if (type === "success") {
|
|
const msg = `${datas.config.url},请求成功`;
|
|
const msg = `${datas.config.url},请求成功`;
|
|
logger.info(msg);
|
|
logger.info(msg);
|
|
} else {
|
|
} else {
|
|
@@ -71,6 +74,8 @@ axios.interceptors.request.use(
|
|
}
|
|
}
|
|
// 设置延迟时效
|
|
// 设置延迟时效
|
|
config.timeout = 10 * 60 * 1000;
|
|
config.timeout = 10 * 60 * 1000;
|
|
|
|
+
|
|
|
|
+ addLog(config, "start");
|
|
return config;
|
|
return config;
|
|
},
|
|
},
|
|
error => {
|
|
error => {
|
|
@@ -87,7 +92,7 @@ axios.interceptors.request.use(
|
|
);
|
|
);
|
|
axios.interceptors.response.use(
|
|
axios.interceptors.response.use(
|
|
response => {
|
|
response => {
|
|
- addLog(response);
|
|
|
|
|
|
+ addLog(response, "success");
|
|
// 关闭loading提示
|
|
// 关闭loading提示
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
queue.shift();
|
|
queue.shift();
|