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));