panxingxin 5 år sedan
förälder
incheckning
f0b6cd870d
4 ändrade filer med 12 tillägg och 22 borttagningar
  1. 9 19
      api/request.js
  2. 1 1
      pages/contract/list.js
  3. 1 1
      pages/qc/list.js
  4. 1 1
      pages/sample/list.js

+ 9 - 19
api/request.js

@@ -13,14 +13,14 @@ import whiteList from './whiteList';
 fly.interceptors.request.use(function (request) {
   fly.lock();
 // console.log('进入fly-request', request);
-wx.showLoading({
+/* wx.showLoading({
   'title': '加载中',
   'mask': true
-});
+}); */
   // 不显示加载页面的接口
   if (request.url.indexOf(whiteList.loading) === -1) {
     // 隐藏loading遮罩
-    wx.hideLoading();
+   // wx.hideLoading();
   }
   // 白名单内url不添加token
   if (request.url.indexOf(whiteList.nullHeaderToken) !== -1) {
@@ -30,6 +30,7 @@ wx.showLoading({
       'X-Tag': 'flyio'
     };
     console.log('nullHeaderToken()')
+  //  wx.hideLoading();
     fly.unlock();
     return request;
   }
@@ -41,6 +42,7 @@ wx.showLoading({
       'content-type': 'application/json',
       'X-Tag': 'flyio'
     })
+    //wx.hideLoading();
     fly.unlock();
     return request;
   }
@@ -53,27 +55,15 @@ wx.showLoading({
        'X-Tag': 'flyio',
        'Authorization': `Bearer ${wx.getStorageSync('token')}`
      })
+    // wx.hideLoading();
      fly.unlock();
      return request;
   } 
   else{
     console.log("没有token,先请求token...");
+  //  wx.hideLoading();
     wx.login({
       success(wxres) {
-/*         requestAPI.userLogin(wxres.code).then(res => {
-          if (res.status === 401) {
-            self.setData({
-              ifUser: false
-            })
-          } else {
-            if (res.data.access_token) {
-              wx.setStorageSync('token', res.data.access_token);
-              wx.switchTab({
-                url: '/pages/home/home',
-              })
-            }
-          }
-        }) */
 
     //锁定当天实例,后续请求会在拦截器外排队
   
@@ -111,11 +101,11 @@ fly.interceptors.response.use(
   (response) => {
     //正常返回
     reqCount =0;
-    wx.hideLoading();
+  //  wx.hideLoading();
     return response
   },
   (err, promise) => {
-    wx.hideLoading();
+  //  wx.hideLoading();
     let msg = ''; 
     if (err.status === 0) {
       msg = '网络连接异常'

+ 1 - 1
pages/contract/list.js

@@ -17,7 +17,7 @@ Page({
   },
   // 获取样品单列表
   getContractList() {
-    wx.showLoading({title: '加载中', icon: 'loading'});
+    //wx.showLoading({title: '加载中', icon: 'loading'});
     let form = {
       current: this.data.current,
       size: this.data.size,

+ 1 - 1
pages/qc/list.js

@@ -25,7 +25,7 @@ Page({
   },
   // 获取样品单列表
   getQcList() {
-    wx.showLoading({title: '加载中', icon: 'loading'});
+    //wx.showLoading({title: '加载中', icon: 'loading'});
     let form = {
       current: this.data.current,
       size: this.data.size,

+ 1 - 1
pages/sample/list.js

@@ -17,7 +17,7 @@ Page({
   },
   // 获取样品单列表
   getSampleList() {
-    wx.showLoading({title: '加载中', icon: 'loading'});
+   // wx.showLoading({title: '加载中', icon: 'loading'});
     let form = {
       current: this.data.current,
       size: this.data.size,