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

Loading…
Cancel
Save