From d79368b0e1325e0cc5adb35baa2651d9a3f066be Mon Sep 17 00:00:00 2001 From: ruibaby Date: Tue, 7 Jan 2020 18:46:36 +0800 Subject: [PATCH] feat: custom permalink. --- src/api/post.js | 19 +++++++++++ src/utils/permissions.js | 2 +- src/views/system/OptionForm.vue | 59 ++++++++++++++++++++++++++++++++- 3 files changed, 78 insertions(+), 2 deletions(-) diff --git a/src/api/post.js b/src/api/post.js index 9653e35d..338e6f01 100644 --- a/src/api/post.js +++ b/src/api/post.js @@ -124,4 +124,23 @@ postApi.postStatus = { text: '私密' } } + +postApi.permalinkType = { + DEFAULT: { + type: 'DEFAULT', + text: '默认' + }, + DATE: { + type: 'DATE', + text: '年月日型' + }, + DAY: { + type: 'DAY', + text: '年月型' + }, + ID: { + type: 'ID', + text: 'ID 型' + } +} export default postApi diff --git a/src/utils/permissions.js b/src/utils/permissions.js index 78a91310..40f99961 100644 --- a/src/utils/permissions.js +++ b/src/utils/permissions.js @@ -5,4 +5,4 @@ export function actionToObject(json) { this.$log.debug('err', e.message) } return [] -} \ No newline at end of file +} diff --git a/src/views/system/OptionForm.vue b/src/views/system/OptionForm.vue index 7825dbd1..e6e18539 100644 --- a/src/views/system/OptionForm.vue +++ b/src/views/system/OptionForm.vue @@ -70,7 +70,7 @@ - + + + + 固定链接 + + + + + + {{ permalinkType[item].text }} + + + + + + + + + + + + + + + + + + + + 保存 + + + API 设置 @@ -675,6 +730,7 @@ import { mapActions } from 'vuex' import optionApi from '@/api/option' import mailApi from '@/api/mail' import attachmentApi from '@/api/attachment' +import postApi from '@/api/post' export default { components: { @@ -683,6 +739,7 @@ export default { data() { return { attachmentType: attachmentApi.type, + permalinkType: postApi.permalinkType, wrapperCol: { xl: { span: 8 }, lg: { span: 8 },