mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-07-26 16:21:14 +08:00
搜索的时候设置timeout,解决全局搜索结果无法打开的问题
This commit is contained in:
@@ -422,7 +422,7 @@ export default {
|
||||
}
|
||||
this.getAllSearch()
|
||||
})
|
||||
sites.forEach(site =>
|
||||
sites.forEach(site => {
|
||||
zy.search(site.key, wd).then(res => {
|
||||
const type = Object.prototype.toString.call(res)
|
||||
if (type === '[object Array]') {
|
||||
@@ -436,7 +436,7 @@ export default {
|
||||
this.searchContents.push(res)
|
||||
}
|
||||
})
|
||||
)
|
||||
})
|
||||
} else {
|
||||
this.show.find = false
|
||||
this.getClass().then(res => {
|
||||
|
||||
@@ -130,14 +130,18 @@ const zy = {
|
||||
this.getSite(key).then(res => {
|
||||
const site = res
|
||||
wd = encodeURI(wd)
|
||||
axios.post(`http://localhost:${this.ports}/api`, { url: site.api + '?wd=' + wd }).then(res => {
|
||||
axios.post(`http://localhost:${this.ports}/api`, { url: site.api + '?wd=' + wd }, { timeout: 2000 }).then(res => {
|
||||
const data = res.data.info
|
||||
const json = parser.parse(data, this.xmlConfig)
|
||||
const videoList = json.rss.list.video
|
||||
resolve(videoList)
|
||||
if (json && json.rss && json.rss.list) {
|
||||
const videoList = json.rss.list.video
|
||||
resolve(videoList)
|
||||
}
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
})
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user