From 81a46b9a5e36fd1032c2ba1cd0e3a4c9f8f7e454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E6=B4=8B=E4=B9=8B=E5=A3=B0?= Date: Thu, 1 Nov 2018 12:26:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=B7=E6=B1=82=E8=B6=85=E6=97=B6=E6=97=B6?= =?UTF-8?q?=E9=95=BF=E8=AE=BE=E7=BD=AE=E4=B8=BA30s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 2 +- pages/index/index.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app.json b/app.json index 76230e0..e639416 100644 --- a/app.json +++ b/app.json @@ -65,7 +65,7 @@ "navigationBarTextStyle": "white" }, "networkTimeout": { - "request": 100, + "request": 30000, "downloadFile": 10000 }, "debug": false diff --git a/pages/index/index.js b/pages/index/index.js index a88e3d6..6e1eabc 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -113,10 +113,12 @@ Page({ }) .catch(err => { console.log(err); - that.setData({ - loading: false, - loadingtext: "网络异常,请检查您的网络设置" - }) + if (err.errMsg == '请求超时,请检查您的网络设置!') { + that.setData({ + loading: false, + loadingtext: "请求超时,请检查您的网络设置!" + }) + } wx.showToast({ title: err.errMsg, icon: 'none', @@ -237,10 +239,10 @@ Page({ }) .catch(err => { console.log(err); - if(err.errMsg=='request:fail timeout'){ + if (err.errMsg =='请求超时,请检查您的网络设置!'){ that.setData({ loading:false, - loadingtext:"网络异常,请检查您的网络设置" + loadingtext:"请求超时,请检查您的网络设置!" }) } if (err.code == 11004) {