|
@@ -2,6 +2,7 @@ import Vue from "vue";
|
|
|
import axios from "axios";
|
|
|
import router from "../router";
|
|
|
import { loadProgressBar } from "axios-progress-bar";
|
|
|
+import networkInformationHint from "./networkInformationHint.js";
|
|
|
|
|
|
const ERROR_MSG_CONFIG = require("./errorMsgConfig").default;
|
|
|
|
|
@@ -40,6 +41,7 @@ function getRootOrgId() {
|
|
|
|
|
|
_$httpWith500Msg.interceptors.request.use(
|
|
|
function(config) {
|
|
|
+ networkInformationHint();
|
|
|
// Do something before request is sent
|
|
|
if (
|
|
|
config.url.includes("/login") === false &&
|
|
@@ -88,6 +90,7 @@ _$httpWith500Msg.interceptors.request.use(
|
|
|
_$http.interceptors.request.use(
|
|
|
// no auto 500 error UI
|
|
|
function(config) {
|
|
|
+ networkInformationHint();
|
|
|
// Do something before request is sent
|
|
|
if (config.url.includes("/login") === false) {
|
|
|
if (!wk_token) {
|
|
@@ -299,5 +302,27 @@ loadProgressBar({}, Vue.$http);
|
|
|
loadProgressBar({}, Vue.$httpWithMsg);
|
|
|
loadProgressBar({}, Vue.$httpWithoutAuth);
|
|
|
|
|
|
+// const update = (type, e) => {
|
|
|
+// // debugger;
|
|
|
+// console.log(type);
|
|
|
+// console.log(
|
|
|
+// "e.target.url: ",
|
|
|
+// e.target.responseURL,
|
|
|
+// " timeStamp: ",
|
|
|
+// e.timeStamp.toFixed(2),
|
|
|
+// " loaded:",
|
|
|
+// e.loaded,
|
|
|
+// " total: ",
|
|
|
+// e.total
|
|
|
+// );
|
|
|
+// console.log(e);
|
|
|
+// };
|
|
|
+// Vue.$httpWithMsg.defaults.onDownloadProgress = e => {
|
|
|
+// update("下载", e);
|
|
|
+// };
|
|
|
+// Vue.$httpWithMsg.defaults.onUploadProgress = e => {
|
|
|
+// update("上传", e);
|
|
|
+// };
|
|
|
+
|
|
|
import "axios-progress-bar/dist/nprogress.css";
|
|
|
export default Plugin;
|