diff --git a/src/api/sheet.js b/src/api/sheet.js
index b139a107..13dce2be 100644
--- a/src/api/sheet.js
+++ b/src/api/sheet.js
@@ -96,4 +96,15 @@ sheetApi.sheetStatus = {
text: '回收站'
}
}
+
+sheetApi.permalinkType = {
+ SECONDARY: {
+ type: 'SECONDARY',
+ text: '二级路径'
+ },
+ ROOT: {
+ type: 'ROOT',
+ text: '根路径'
+ },
+}
export default sheetApi
diff --git a/src/store/modules/option.js b/src/store/modules/option.js
index 57a049ae..f6420c8c 100644
--- a/src/store/modules/option.js
+++ b/src/store/modules/option.js
@@ -9,6 +9,7 @@ const keys = [
'attachment_upload_max_files',
'sheet_prefix',
'post_permalink_type',
+ 'sheet_permalink_type',
'archives_prefix',
'path_suffix',
'default_editor',
diff --git a/src/views/sheet/components/SheetSettingDrawer.vue b/src/views/sheet/components/SheetSettingDrawer.vue
index 40843798..bdfb2d21 100644
--- a/src/views/sheet/components/SheetSettingDrawer.vue
+++ b/src/views/sheet/components/SheetSettingDrawer.vue
@@ -296,10 +296,20 @@ export default {
return datetimeFormat(new Date(), 'YYYY-MM-DD HH:mm:ss')
},
fullPath() {
+ const permalinkType = this.options.sheet_permalink_type
const blogUrl = this.options.blog_url
const sheetPrefix = this.options.sheet_prefix
const pathSuffix = this.options.path_suffix ? this.options.path_suffix : ''
- return `${blogUrl}/${sheetPrefix}/${this.selectedSheet.slug ? this.selectedSheet.slug : '{slug}'}${pathSuffix}`
+ switch (permalinkType) {
+ case 'SECONDARY':
+ return `${blogUrl}/${sheetPrefix}/${
+ this.selectedSheet.slug ? this.selectedSheet.slug : '{slug}'
+ }${pathSuffix}`
+ case 'ROOT':
+ return `${blogUrl}/${this.selectedSheet.slug ? this.selectedSheet.slug : '{slug}'}${pathSuffix}`
+ default:
+ return ''
+ }
},
},
methods: {
diff --git a/src/views/system/optiontabs/PermalinkTab.vue b/src/views/system/optiontabs/PermalinkTab.vue
index a618571a..16a79ed0 100644
--- a/src/views/system/optiontabs/PermalinkTab.vue
+++ b/src/views/system/optiontabs/PermalinkTab.vue
@@ -18,13 +18,47 @@
{{ permalinkType[item].text }}
+ >{{ postPermalinkType[item].text }}
-
+
+
+ {{ options.blog_url }}/{{ options.archives_prefix }}{{ options.path_suffix }}
+
+
+
+
+
+ {{ options.blog_url }}/{{ options.categories_prefix }}/{slug}{{ options.path_suffix }}
+
+
+
+
+
+ {{ options.blog_url }}/{{ options.tags_prefix }}/{slug}{{ options.path_suffix }}
+
+
+
+
+
+ {{ options.blog_url }}/{{ options.sheet_prefix }}/{slug}{{ options.path_suffix }}
+ {{ options.blog_url }}/{slug}{{ options.path_suffix }}
+
+
+ {{ sheetPermalinkType[item].text }}
+
+
+
{{ options.blog_url }}/{{ options.sheet_prefix }}/{slug}{{ options.path_suffix }}
@@ -48,24 +82,6 @@
-
-
- {{ options.blog_url }}/{{ options.archives_prefix }}{{ options.path_suffix }}
-
-
-
-
-
- {{ options.blog_url }}/{{ options.categories_prefix }}/{slug}{{ options.path_suffix }}
-
-
-
-
-
- {{ options.blog_url }}/{{ options.tags_prefix }}/{slug}{{ options.path_suffix }}
-
-
-
* 格式为:.{suffix}
,仅对内建路径有效
@@ -89,6 +105,7 @@