Ver Fonte

请求超时

zhaoxiaohai há 3 anos atrás
pai
commit
b902e30d46
3 ficheiros alterados com 11 adições e 2 exclusões
  1. 0 1
      app.js
  2. 6 1
      app.json
  3. 5 0
      utils/Http.js

+ 0 - 1
app.js

@@ -20,7 +20,6 @@ App({
         "fclienttype": "MOBILE"
       }
     }).then(res => {
-      console.log("banner", res)
       that.globalData.bannerDataList = res.data;
     })
 

+ 6 - 1
app.json

@@ -74,5 +74,10 @@
         "navigationBarTextStyle": "white"
     },
     "sitemapLocation": "sitemap.json",
-    "lazyCodeLoading": "requiredComponents"
+    "lazyCodeLoading": "requiredComponents",
+    "networkTimeout": {
+        "request": 10000,
+        "downloadFile": 10000
+    },
+    "debug": true
 }

+ 5 - 0
utils/Http.js

@@ -27,7 +27,12 @@ class HTTP {
                 wx.hideLoading()
             },
             fial: (err) => {
+                console.log(123)
                 reject(err);
+                wx.showToast({
+                    title: '请求失败,请稍后再试',
+                    icon: 'none'
+                })
                 wx.hideLoading();
             }
         })