Eddie 3 years ago
parent
commit
e4ac8c874e
2 changed files with 9 additions and 3 deletions
  1. +3
    -2
      src/api/books-management.js
  2. +6
    -1
      src/views/books-management/article-page/components/edit-dialog.vue

+ 3
- 2
src/api/books-management.js View File

@@ -28,10 +28,11 @@ export function getBooksList(params) {
}) })
} }


export function updateBooks(id) {
export function updateBooks(id, params) {
return request({ return request({
url: `/book/update/${id}`, // 编辑书籍 url: `/book/update/${id}`, // 编辑书籍
method: 'put'
method: 'put',
params: params
}) })
} }




+ 6
- 1
src/views/books-management/article-page/components/edit-dialog.vue View File

@@ -126,7 +126,12 @@ export default {
}, },
methods: { methods: {
_postRequest() { _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) { if (parseInt(resp.error_code) === 0) {
this.$message.success('操作成功!') this.$message.success('操作成功!')
this.$emit('handle-success') this.$emit('handle-success')


Loading…
Cancel
Save