소스 검색

请求超时时长设置为30s

tags/2.2.9
海洋之声 6 년 전
부모
커밋
81a46b9a5e
2개의 변경된 파일9개의 추가작업 그리고 7개의 파일을 삭제
  1. +1
    -1
      app.json
  2. +8
    -6
      pages/index/index.js

+ 1
- 1
app.json 파일 보기

@@ -65,7 +65,7 @@
"navigationBarTextStyle": "white"
},
"networkTimeout": {
"request": 100,
"request": 30000,
"downloadFile": 10000
},
"debug": false

+ 8
- 6
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) {


불러오는 중...
취소
저장