文章目录
一、app.json配置属性之networkTimeout
全局设置各类网络请求的超时时间,单位均为毫秒。
属性 | 类型 | 必填 | 默认值 | 说明 |
---|---|---|---|---|
request | number | 否 | 60000 | wx.request 的超时时间,单位:毫秒。 |
connectSocket | number | 否 | 60000 | wx.connectSocket 的超时时间,单位:毫秒。 |
uploadFile | number | 否 | 60000 | wx.uploadFile 的超时时间,单位:毫秒。 |
downloadFile | number | 否 | 60000 | wx.downloadFile 的超时时间,单位:毫秒。 |
配置案例如下:
{
"entryPagePath": "pages/index/index",
"pages": [
"pages/index/index",
"pages/getOpenId/index",
"pages/getMiniProgramCode/index",
"pages/deployService/index",
"pages/createCollection/index",
"pages/uploadFile/index",
"pages/selectRecord/index",
"pages/updateRecord/index",
"pages/updateRecordResult/index",
"pages/updateRecordSuccess/index",
"pages/sumRecord/index",
"pages/sumRecordResult/index"
],
"window": {
"backgroundColor": "#F6F6F6",
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#F6F6F6",
"navigationBarTitleText": "云开发 QuickStart",
"navigationBarTextStyle": "black"
},
"tabBar": {
"list": [
{
"pagePath": "pages/index/index",
"text": "首页"
},
{
"pagePath": "pages/getOpenId/index",
"text": "看资讯"
},
{
"pagePath": "pages/getMiniProgramCode/index",
"text": "我的"
}
],
"backgroundColor": "#fff",
"color": "#000",
"selectedColor": "#0286f1"
},
"networkTimeout": {
"request": 10000,
"downloadFile": 10000,
"connectSocket": 10000,
"uploadFile": 10000
},
"sitemapLocation": "sitemap.json",
"style": "v2"
}