From 9d338912203978d94cda8cdb4d772a5cdc8d5faf Mon Sep 17 00:00:00 2001 From: x_ying <2438792676@qq.com> Date: Tue, 27 Sep 2022 14:16:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E4=B9=A6=E6=8E=A8=E8=8D=90=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newBook.vue | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/views/newBook.vue b/src/views/newBook.vue index b7c3e26..5c31b27 100644 --- a/src/views/newBook.vue +++ b/src/views/newBook.vue @@ -28,16 +28,20 @@ export default { this.getBookData() }, methods: { - async getBookData() { - const res = await FetchNewBookRecommend().then(res => { + getBookData() { + const params = { + libcode: this.libcode, + pageNo: 1, + pageSize: 10 + } + FetchNewBookRecommend(params).then(res => { console.log(res, 'res') - return res + res.newbookList.forEach(item => { + this.getCoverByISBN(item.isbn.replace(/\-/g, ''), item) + }) }).catch(() => { this.$message.error('接口错误') }) - await res.forEach(item => { - this.getCoverByISBN(item.isbn.replace(/\-/g, ''), item) - }) }, getCoverByISBN(isbn, item) { const params = {