diff --git a/src/api/category.js b/src/api/category.js index aac5441d..398715a8 100644 --- a/src/api/category.js +++ b/src/api/category.js @@ -11,4 +11,19 @@ categoryApi.listAll = () => { }) } +categoryApi.create = (category) => { + return service({ + url: baseUrl, + data: category, + method: 'post' + }) +} + +categoryApi.delete = categoryId => { + return service({ + url: `${baseUrl}/${categoryId}`, + method: 'delete' + }) +} + export default categoryApi diff --git a/src/views/post/CategoryList.vue b/src/views/post/CategoryList.vue index 6e3d2a32..72976bbb 100644 --- a/src/views/post/CategoryList.vue +++ b/src/views/post/CategoryList.vue @@ -11,10 +11,10 @@ - + - + @@ -22,10 +22,10 @@ - + - 保存 + 保存 @@ -38,7 +38,23 @@ :xs="24" :style="{ 'padding-bottom': '12px' }"> - + + + {{ text }} + + + 编辑 + + + 删除 + + + @@ -46,6 +62,8 @@