diff --git a/src/api/option.js b/src/api/option.js
index f3ff61cc..d1d2c622 100644
--- a/src/api/option.js
+++ b/src/api/option.js
@@ -30,15 +30,45 @@ optionApi.save = options => {
})
}
+optionApi.create = option => {
+ return service({
+ url: baseUrl,
+ data: option,
+ method: 'post'
+ })
+}
+
+optionApi.delete = optionId => {
+ return service({
+ url: `${baseUrl}/${optionId}`,
+ method: 'delete'
+ })
+}
+
+optionApi.get = optionId => {
+ return service({
+ url: `${baseUrl}/${optionId}`,
+ method: 'get'
+ })
+}
+
+optionApi.update = (optionId, option) => {
+ return service({
+ url: `${baseUrl}/${optionId}`,
+ data: option,
+ method: 'put'
+ })
+}
+
optionApi.type = {
INTERNAL: {
- type: 'internal',
+ value: 'INTERNAL',
text: '系统'
},
CUSTOM: {
- type: 'custom',
+ value: 'CUSTOM',
text: '自定义'
}
}
-export default optionApi
+export default optionApi
\ No newline at end of file
diff --git a/src/views/post/CategoryList.vue b/src/views/post/CategoryList.vue
index 7eb580e7..98fa83b3 100644
--- a/src/views/post/CategoryList.vue
+++ b/src/views/post/CategoryList.vue
@@ -300,13 +300,11 @@ export default {
categoryApi.update(this.categoryToCreate.id, this.categoryToCreate).then(response => {
this.$message.success('更新成功!')
this.loadCategories()
- this.categoryToCreate = {}
})
} else {
categoryApi.create(this.categoryToCreate).then(response => {
this.$message.success('保存成功!')
this.loadCategories()
- this.categoryToCreate = {}
})
}
this.handleAddCategory()
diff --git a/src/views/system/developer/tabs/OptionsList.vue b/src/views/system/developer/tabs/OptionsList.vue
index c8bcc567..3e544702 100644
--- a/src/views/system/developer/tabs/OptionsList.vue
+++ b/src/views/system/developer/tabs/OptionsList.vue
@@ -59,6 +59,7 @@