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')