lrf402788946 %!s(int64=4) %!d(string=hai) anos
pai
achega
0a1188e8a5
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      src/util/axios-wrapper.js

+ 7 - 1
src/util/axios-wrapper.js

@@ -5,6 +5,7 @@ import _ from 'lodash';
 import Axios from 'axios';
 import Axios from 'axios';
 import { Util, Error } from 'naf-core';
 import { Util, Error } from 'naf-core';
 // import { Indicator } from 'mint-ui';
 // import { Indicator } from 'mint-ui';
+import { Toast } from 'vant';
 import util from './user-util';
 import util from './user-util';
 
 
 const { trimData, isNullOrUndefined } = Util;
 const { trimData, isNullOrUndefined } = Util;
@@ -64,6 +65,10 @@ export default class AxiosWrapper {
     // Indicator.open({
     // Indicator.open({
     //   spinnerType: 'fading-circle',
     //   spinnerType: 'fading-circle',
     // });
     // });
+    let toast = Toast.loading({
+      message: '加载中...',
+      forbidClick: true,
+    });
 
 
     try {
     try {
       const axios = Axios.create({
       const axios = Axios.create({
@@ -105,12 +110,13 @@ export default class AxiosWrapper {
       );
       );
       return { errcode: ErrorCode.SERVICE_FAULT, errmsg, details: err.message };
       return { errcode: ErrorCode.SERVICE_FAULT, errmsg, details: err.message };
     } finally {
     } finally {
-    /* eslint-disable */
+      /* eslint-disable */
       currentRequests -= 1;
       currentRequests -= 1;
       if (currentRequests <= 0) {
       if (currentRequests <= 0) {
         currentRequests = 0;
         currentRequests = 0;
         // Indicator.close();
         // Indicator.close();
       }
       }
+      toast.clear();
     }
     }
   }
   }
 }
 }