Browse Source

新书推荐 接口调用

master
x_ying 2 years ago
parent
commit
b17d685b35
  1. 7
      src/views/newBookRecommend.vue

7
src/views/newBookRecommend.vue

@ -47,7 +47,6 @@ export default {
}
},
created() {
// this.rankingList = data.ranking
this.getBookList()
},
mounted() {
@ -74,17 +73,17 @@ export default {
},
getBookList() {
FetchNewBookRecommend().then(res => {
console.log(res, 'res')
this.rankingList = res
this.rankingList.forEach(item => {
this.getCoverByISBN(item.isbn.replace(/\-/g, ''))
if (this.coverUrl) {
item.coverUrl = this.coverUrl
} else {
item.coverUrl = ''
}
this.coverUrl = null
})
}).catch(err => {
console.log(err)
}).catch(() => {
this.$message.error('接口错误')
})
},

Loading…
Cancel
Save