diff --git a/.env b/.env new file mode 100644 index 00000000..612664a4 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +NODE_ENV=production +PUBLIC_PATH=https://cdn.jsdelivr.net/npm/halo-admin@1.2.0/dist/ \ No newline at end of file diff --git a/.env.development b/.env.development new file mode 100644 index 00000000..6a9d8879 --- /dev/null +++ b/.env.development @@ -0,0 +1,2 @@ +NODE_ENV=development +PUBLIC_PATH=/ \ No newline at end of file diff --git a/src/api/post.js b/src/api/post.js index 9653e35d..9e3f02fb 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/api/staticPage.js b/src/api/staticPage.js new file mode 100644 index 00000000..10f5150f --- /dev/null +++ b/src/api/staticPage.js @@ -0,0 +1,39 @@ +import service from '@/utils/service' + +const baseUrl = '/api/admin/static_page' + +const staticPageApi = {} + +staticPageApi.list = () => { + return service({ + url: baseUrl, + method: 'get' + }) +} + +staticPageApi.generate = () => { + return service({ + url: `${baseUrl}/generate`, + method: 'get' + }) +} + +staticPageApi.deploy = () => { + return service({ + url: `${baseUrl}/deploy`, + method: 'get' + }) +} + +staticPageApi.deployType = { + GIT: { + type: 'GIT', + text: 'Git' + }, + NETLIFY: { + type: 'NETLIFY', + text: 'Netlify' + } +} + +export default staticPageApi diff --git a/src/components/Menu/menu.render.js b/src/components/Menu/menu.render.js index fa0733ef..ccf8631c 100644 --- a/src/components/Menu/menu.render.js +++ b/src/components/Menu/menu.render.js @@ -79,7 +79,7 @@ export default { const subItem = [h('span', { slot: 'title' }, [this.renderIcon(h, menu.meta.icon), h('span', [menu.meta.title])])] const itemArr = [] const pIndex_ = pIndex + '_' + index - console.log('menu', menu) + this.$log.debug('menu', menu) if (!menu.hideChildrenInMenu) { menu.children.forEach(function(item, i) { itemArr.push(this2_.renderItem(h, item, pIndex_, i)) diff --git a/src/components/Upload/FilePondUpload.vue b/src/components/Upload/FilePondUpload.vue index 8072cae4..8c739ae6 100644 --- a/src/components/Upload/FilePondUpload.vue +++ b/src/components/Upload/FilePondUpload.vue @@ -120,7 +120,7 @@ export default { }, methods: { handleFilePondInit() { - console.log('FilePond has initialized') + this.$log.debug('FilePond has initialized') }, handleClearFileList() { this.$refs.pond.removeFiles() diff --git a/src/components/global.less b/src/components/global.less index 8d3d996e..e3e5c9ce 100644 --- a/src/components/global.less +++ b/src/components/global.less @@ -911,4 +911,8 @@ body { img { width: 100%; } +} + +.ant-input-group-addon { + line-height: initial !important; } \ No newline at end of file diff --git a/src/config/router.config.js b/src/config/router.config.js index 2c32156c..c4fed704 100644 --- a/src/config/router.config.js +++ b/src/config/router.config.js @@ -185,6 +185,13 @@ export const asyncRouterMap = [ component: () => import('@/views/system/ToolList'), meta: { title: '小工具', hiddenHeaderContent: false } }, + { + path: '/system/tools/staticpages', + name: 'StaticPagesManage', + hidden: true, + component: () => import('@/views/system/staticpages/StaticPagesManage'), + meta: { title: '静态部署', hiddenHeaderContent: false } + }, { path: '/system/about', name: 'About', diff --git a/src/store/modules/option.js b/src/store/modules/option.js index 7dd5cc0f..476f5b08 100644 --- a/src/store/modules/option.js +++ b/src/store/modules/option.js @@ -8,7 +8,11 @@ const keys = [ 'developer_mode', 'attachment_upload_image_preview_enable', 'attachment_upload_max_parallel_uploads', - 'attachment_upload_max_files' + 'attachment_upload_max_files', + 'sheet_prefix', + 'post_permalink_type', + 'archives_prefix', + 'path_suffix' ] const option = { state: { diff --git a/src/utils/filter.js b/src/utils/filter.js index 26016714..636f3161 100644 --- a/src/utils/filter.js +++ b/src/utils/filter.js @@ -22,6 +22,14 @@ Vue.filter('moment', function(dataStr, pattern = 'YYYY-MM-DD HH:mm') { return moment(dataStr).format(pattern) }) +Vue.filter('moment_post_date', function(dataStr, pattern = '/YYYY/M/') { + return moment(dataStr).format(pattern) +}) + +Vue.filter('moment_post_day', function(dataStr, pattern = '/YYYY/M/D/') { + return moment(dataStr).format(pattern) +}) + Vue.filter('timeAgo', timeAgo) Vue.filter('fileSizeFormat', function(value) { diff --git a/src/utils/permissions.js b/src/utils/permissions.js index 642c2348..40f99961 100644 --- a/src/utils/permissions.js +++ b/src/utils/permissions.js @@ -2,7 +2,7 @@ export function actionToObject(json) { try { return JSON.parse(json) } catch (e) { - console.log('err', e.message) + this.$log.debug('err', e.message) } return [] } diff --git a/src/views/attachment/components/AttachmentDetailDrawer.vue b/src/views/attachment/components/AttachmentDetailDrawer.vue index 30a6ca18..555ca85e 100644 --- a/src/views/attachment/components/AttachmentDetailDrawer.vue +++ b/src/views/attachment/components/AttachmentDetailDrawer.vue @@ -269,11 +269,11 @@ export default { const text = `${encodeURI(this.attachment.path)}` this.$copyText(text) .then(message => { - console.log('copy', message) + this.$log.debug('copy', message) this.$message.success('复制成功!') }) .catch(err => { - console.log('copy.err', err) + this.$log.debug('copy.err', err) this.$message.error('复制失败!') }) }, @@ -281,11 +281,11 @@ export default { const text = `![${this.attachment.name}](${encodeURI(this.attachment.path)})` this.$copyText(text) .then(message => { - console.log('copy', message) + this.$log.debug('copy', message) this.$message.success('复制成功!') }) .catch(err => { - console.log('copy.err', err) + this.$log.debug('copy.err', err) this.$message.error('复制失败!') }) }, diff --git a/src/views/comment/components/CommentDetail.vue b/src/views/comment/components/CommentDetail.vue index 6cdb7e25..2fc44e3e 100644 --- a/src/views/comment/components/CommentDetail.vue +++ b/src/views/comment/components/CommentDetail.vue @@ -56,13 +56,13 @@ {{ comment.post.title }} {{ comment.sheet.title }} diff --git a/src/views/system/staticpages/tabs/DeploySettingsForm.vue b/src/views/system/staticpages/tabs/DeploySettingsForm.vue new file mode 100644 index 00000000..ffd95b09 --- /dev/null +++ b/src/views/system/staticpages/tabs/DeploySettingsForm.vue @@ -0,0 +1,106 @@ + + diff --git a/src/views/system/staticpages/tabs/SettingsForm.vue b/src/views/system/staticpages/tabs/SettingsForm.vue new file mode 100644 index 00000000..2202e09b --- /dev/null +++ b/src/views/system/staticpages/tabs/SettingsForm.vue @@ -0,0 +1,10 @@ + + diff --git a/src/views/system/staticpages/tabs/StaticPagesList.vue b/src/views/system/staticpages/tabs/StaticPagesList.vue new file mode 100644 index 00000000..56fc626e --- /dev/null +++ b/src/views/system/staticpages/tabs/StaticPagesList.vue @@ -0,0 +1,113 @@ + + diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index 4e1f7d98..1caddda7 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -47,6 +47,7 @@ :style="{'animation-delay': '0.3s'}" > { - // Go to dashboard - this.loginSuccess() - }) + this.landing = true + this.login({ username: this.username, password: this.password }) + .then(response => { + // Go to dashboard + this.loginSuccess() + }) + .finally(() => { + setTimeout(() => { + this.landing = false + }, 500) + }) }, loginSuccess() { // Cache the user info diff --git a/src/views/user/Profile.vue b/src/views/user/Profile.vue index 33116b8f..3730353b 100644 --- a/src/views/user/Profile.vue +++ b/src/views/user/Profile.vue @@ -107,13 +107,22 @@ - + - + - +