From 7f690c940667111a710567f79a7417ec6f647c4a Mon Sep 17 00:00:00 2001 From: hupeng Date: Mon, 24 Jun 2019 14:51:45 +0800 Subject: [PATCH] =?UTF-8?q?[=E9=80=9A=E4=BF=A1][=E4=BF=AE=E5=A4=8D]:?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E4=B8=BA=E5=BC=82=E6=AD=A5=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.js | 13 +++++++------ HttpUtils.js | 8 +++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/App.js b/App.js index 864586f..7a4ffbe 100644 --- a/App.js +++ b/App.js @@ -307,17 +307,17 @@ componentDidMount() { }) } -async routine() { +routine() { hbRequestCount -=1; getAdDataCount -=1; pageChangeCount -=1; try { if (getAdDataCount<=0) { - await this.getAdDataList(false) + this.getAdDataList(false) getAdDataCount = heartConfig.dataRefreshInterval } else if (hbRequestCount<=0) { - await this.hbRequest() + this.hbRequest() hbRequestCount = heartConfig.heartbeatInterval } @@ -328,8 +328,8 @@ async routine() { this.setState({ contentDisplayStatus: true}) } } else { - await this.getBaseInfo() - await this.getAdDataList(true) + this.getBaseInfo() + this.getAdDataList(true) } pageChangeCount = heartConfig.pageChangeInterval } @@ -423,7 +423,8 @@ getContentViewItem(contentItem, annomation) { - + {/* */} + {/* 优惠券底部商户名称 */} diff --git a/HttpUtils.js b/HttpUtils.js index be59d85..86cf879 100644 --- a/HttpUtils.js +++ b/HttpUtils.js @@ -8,7 +8,13 @@ export default class HttpUtil { */ static get(url) { request = new Promise((resolve, reject) => { - fetch(url) + fetch(url, { + method: 'GET', + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json' + } + }) .then(response => response.json()) .then(result => resolve(result)) }).catch(e => reject(e.message));