diff --git a/src/views/post/PostEdit.vue b/src/views/post/PostEdit.vue index 56081b73..8aab3a21 100644 --- a/src/views/post/PostEdit.vue +++ b/src/views/post/PostEdit.vue @@ -38,7 +38,7 @@ @@ -202,6 +202,7 @@ import 'mavon-editor/dist/css/index.css' import tagApi from '@/api/tag' import categoryApi from '@/api/category' import postApi from '@/api/post' +import optionApi from '@/api/option' export default { components: { TagSelect, @@ -231,12 +232,15 @@ export default { selectedTagIds: [], postToStage: {}, categoryToCreate: {}, - timer: null + timer: null, + options: [], + keys: ['blog_url'] } }, created() { this.loadTags() this.loadCategories() + this.loadOptions() clearInterval(this.timer) this.timer = null this.autoSaveTimer() @@ -279,6 +283,11 @@ export default { this.categories = response.data.data }) }, + loadOptions() { + optionApi.listAll(this.keys).then(response => { + this.options = response.data.data + }) + }, createOrUpdatePost(createSuccess, updateSuccess) { // Set category ids this.postToStage.categoryIds = this.selectedCategoryIds diff --git a/src/views/sheet/SheetEdit.vue b/src/views/sheet/SheetEdit.vue index ef8d4f97..e8ed2977 100644 --- a/src/views/sheet/SheetEdit.vue +++ b/src/views/sheet/SheetEdit.vue @@ -42,7 +42,7 @@ @@ -135,6 +135,7 @@ import { toolbars } from '@/core/const' import 'mavon-editor/dist/css/index.css' import sheetApi from '@/api/sheet' import themeApi from '@/api/theme' +import optionApi from '@/api/option' export default { components: { mavonEditor, @@ -156,11 +157,14 @@ export default { sheetSettingVisible: false, customTpls: [], sheetToStage: {}, - timer: null + timer: null, + options: [], + keys: ['blog_url'] } }, created() { this.loadCustomTpls() + this.loadOptions() clearInterval(this.timer) this.timer = null this.autoSaveTimer() @@ -196,6 +200,11 @@ export default { this.customTpls = response.data.data }) }, + loadOptions() { + optionApi.listAll(this.keys).then(response => { + this.options = response.data.data + }) + }, handlePublishClick() { this.sheetToStage.status = 'PUBLISHED' this.saveSheet()