From de95ee77ae0d4f3fa08a658954360e5696eab0e4 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Fri, 6 Sep 2019 16:55:50 +0800 Subject: [PATCH] Support set password to post. --- src/api/journal.js | 2 +- src/api/post.js | 5 +++++ src/views/post/PostList.vue | 19 +++++++++++++---- src/views/post/components/PostSetting.vue | 6 ++++++ src/views/sheet/SheetList.vue | 2 +- src/views/sheet/internal/JournalList.vue | 19 +++++++++++++---- src/views/system/OptionForm.vue | 26 ++++++++++++++++++----- 7 files changed, 64 insertions(+), 15 deletions(-) diff --git a/src/api/journal.js b/src/api/journal.js index 09786d1ee..59472ec83 100644 --- a/src/api/journal.js +++ b/src/api/journal.js @@ -46,7 +46,7 @@ journalApi.journalType = { PUBLIC: { text: '公开' }, - PRIVATE: { + INTIMATE: { text: '私密' } } diff --git a/src/api/post.js b/src/api/post.js index 0d0a1b326..5709a6a02 100644 --- a/src/api/post.js +++ b/src/api/post.js @@ -81,6 +81,11 @@ postApi.postStatus = { color: 'red', status: 'error', text: '回收站' + }, + INTIMATE: { + color: 'blue', + status: 'success', + text: '私密' } } export default postApi diff --git a/src/views/post/PostList.vue b/src/views/post/PostList.vue index a87a6f321..9ef811037 100644 --- a/src/views/post/PostList.vue +++ b/src/views/post/PostList.vue @@ -92,7 +92,7 @@ {{ text }} + + + {{ text }} @@ -250,7 +261,7 @@ 编辑 回收站 diff --git a/src/views/post/components/PostSetting.vue b/src/views/post/components/PostSetting.vue index 6261e121d..bc71cd3c5 100644 --- a/src/views/post/components/PostSetting.vue +++ b/src/views/post/components/PostSetting.vue @@ -30,6 +30,12 @@ > + + + {{ text }} diff --git a/src/views/sheet/internal/JournalList.vue b/src/views/sheet/internal/JournalList.vue index 24fd7c3d3..e2521a4af 100644 --- a/src/views/sheet/internal/JournalList.vue +++ b/src/views/sheet/internal/JournalList.vue @@ -118,8 +118,11 @@ {{ item.commentCount }} - - + + @@ -399,7 +402,7 @@ export default { handleEdit(item) { this.title = '编辑' this.journal = item - this.isPublic = item.type !== 'PRIVATE' + this.isPublic = item.type !== 'INTIMATE' this.visible = true // 为编辑时需要回显图片数组赋值,并隐藏图片上传框 // this.plusPhotoVisible = false @@ -442,7 +445,15 @@ export default { createOrUpdateJournal() { // 给属性填充数据 // this.journal.photos = this.journalPhotos - this.journal.type = this.isPublic ? 'PUBLIC' : 'PRIVATE' + this.journal.type = this.isPublic ? 'PUBLIC' : 'INTIMATE' + + if (!this.journal.content) { + this.$notification['error']({ + message: '提示', + description: '发布内容不能为空!' + }) + return + } if (this.journal.id) { journalApi.update(this.journal.id, this.journal).then(response => { diff --git a/src/views/system/OptionForm.vue b/src/views/system/OptionForm.vue index 9044f8036..440243cf5 100644 --- a/src/views/system/OptionForm.vue +++ b/src/views/system/OptionForm.vue @@ -377,7 +377,10 @@ label="Secret Key:" :wrapper-col="wrapperCol" > - + - + - + - + @@ -571,6 +583,7 @@ > @@ -660,7 +673,10 @@ label="CDN 加速域名:" :wrapper-col="wrapperCol" > - +