一、app.json配置属性之networkTimeout
全局设置各类网络请求的超时时间,单位均为毫秒。
配置案例如下:
{ "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" }