|
|
@@ -92,13 +92,7 @@ export default {
|
|
|
this.loading = false
|
|
|
const respData = resp.data
|
|
|
if (respData.length === 0) {
|
|
|
- this.$notify(
|
|
|
- {
|
|
|
- message: '已经到底啦~~~',
|
|
|
- type: 'info',
|
|
|
- duration: 1000
|
|
|
- }
|
|
|
- )
|
|
|
+ this.$message('已经到底啦~~~')
|
|
|
return
|
|
|
}
|
|
|
|
|
|
@@ -121,14 +115,12 @@ export default {
|
|
|
}
|
|
|
)
|
|
|
}
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message.error(error)
|
|
|
+ }).finally(() => {
|
|
|
})
|
|
|
},
|
|
|
load() {
|
|
|
- /* this.max++
|
|
|
- if (this.max > 10) {
|
|
|
- return
|
|
|
- }*/
|
|
|
-
|
|
|
this.loading = true
|
|
|
setTimeout(() => {
|
|
|
this.videoRecommendWrapper(this.nextId)
|
|
|
@@ -139,6 +131,9 @@ export default {
|
|
|
if (resp.code === 0) {
|
|
|
this.carouselList = resp.data
|
|
|
}
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message.error(error)
|
|
|
+ }).finally(() => {
|
|
|
})
|
|
|
},
|
|
|
initServerSendEvent() {
|
|
|
@@ -151,13 +146,14 @@ export default {
|
|
|
|
|
|
const that = this
|
|
|
source.onmessage = function(event) {
|
|
|
+ console.log('update sse data')
|
|
|
const dataList = JSON.parse(event.data)
|
|
|
if (dataList.length !== 0) {
|
|
|
that.carouselList = dataList
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- console.log('抱歉,你的浏览器不支持 SSE...')
|
|
|
+ this.$message.error('抱歉,你的浏览器不支持 SSE...')
|
|
|
}
|
|
|
}
|
|
|
}
|