From 771f5b8c176f6af2058eb26dd2caf74a5b4cab6b Mon Sep 17 00:00:00 2001 From: xiexiang <9ga-8vwj45xe1@dingtalk.com> Date: Fri, 13 Aug 2021 10:49:49 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=B9=A6=E7=B1=8D=E7=AE=A1=E7=90=86=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/books-management.js | 5 +++-- .../article-page/components/edit-dialog.vue | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/api/books-management.js b/src/api/books-management.js index 99ef733..c537d60 100644 --- a/src/api/books-management.js +++ b/src/api/books-management.js @@ -28,10 +28,11 @@ export function getBooksList(params) { }) } -export function updateBooks(id) { +export function updateBooks(id, params) { return request({ url: `/book/update/${id}`, // 编辑书籍 - method: 'put' + method: 'put', + params: params }) } diff --git a/src/views/books-management/article-page/components/edit-dialog.vue b/src/views/books-management/article-page/components/edit-dialog.vue index a3ef737..4c94f1e 100644 --- a/src/views/books-management/article-page/components/edit-dialog.vue +++ b/src/views/books-management/article-page/components/edit-dialog.vue @@ -126,7 +126,12 @@ export default { }, methods: { _postRequest() { - updateBooks(Number(this.formData.id)).then(resp => { + const params = { + name: this.formData.book_name, + category_id: this.formData.book_type, + desc: this.formData.book_intro + } + updateBooks(Number(this.formData.id), params).then(resp => { if (parseInt(resp.error_code) === 0) { this.$message.success('操作成功!') this.$emit('handle-success')