🧣 修复第一次加载资源失败的bug

This commit is contained in:
hunlongyu
2020-10-26 20:24:35 +08:00
parent e984d0a349
commit 86130e6c53

View File

@@ -474,12 +474,15 @@ export default {
},
getAllsites () {
sites.all().then(res => {
console.log(res, 'film get all sites')
if (res.length <= 0) {
this.site = {}
this.type = {}
this.list = []
} else {
this.sites = res.filter(x => x.isActive)
this.sites = res.filter((item, index, self) => {
return self.indexOf(item) >= 0
})
this.site = this.sites[0]
this.siteClick(this.site)
}