移除下面热搜词的加载

pull/453/head
lyswhut 2021-01-16 01:11:55 +08:00
parent 3e343a80fd
commit 4c44310fea
1 changed files with 9 additions and 8 deletions

View File

@ -1,17 +1,18 @@
import { xmRequest } from './util'
// import { xmRequest } from './util'
export default {
_requestObj: null,
async getList(retryNum = 0) {
if (this._requestObj) this._requestObj.cancelHttp()
if (retryNum > 2) return Promise.reject(new Error('try max num'))
// if (this._requestObj) this._requestObj.cancelHttp()
// if (retryNum > 2) return Promise.reject(new Error('try max num'))
const _requestObj = xmRequest('/api/search/getHotSearchWords')
const { body, statusCode } = await _requestObj.promise
// console.log(body)
if (statusCode != 200 || body.code !== 'SUCCESS') return this.getList(++retryNum)
// const _requestObj = xmRequest('/api/search/getHotSearchWords')
// const { body, statusCode } = await _requestObj.promise
// // console.log(body)
// if (statusCode != 200 || body.code !== 'SUCCESS') return this.getList(++retryNum)
// // console.log(body, statusCode)
return { source: 'xm', list: this.filterList(body.result.data.hotWords) }
// return { source: 'xm', list: this.filterList(body.result.data.hotWords) }
return { source: 'xm', list: [] }
},
filterList(rawList) {
return rawList.map(item => item.word)