Support set password to post.

pull/40/head
ruibaby 2019-09-06 16:55:50 +08:00
parent aaa5903aea
commit 887d2c68fb
7 changed files with 64 additions and 15 deletions

View File

@ -46,7 +46,7 @@ journalApi.journalType = {
PUBLIC: { PUBLIC: {
text: '公开' text: '公开'
}, },
PRIVATE: { INTIMATE: {
text: '私密' text: '私密'
} }
} }

View File

@ -81,6 +81,11 @@ postApi.postStatus = {
color: 'red', color: 'red',
status: 'error', status: 'error',
text: '回收站' text: '回收站'
},
INTIMATE: {
color: 'blue',
status: 'success',
text: '私密'
} }
} }
export default postApi export default postApi

View File

@ -92,7 +92,7 @@
</a-menu-item> </a-menu-item>
<a-menu-item <a-menu-item
key="2" key="2"
v-if="queryParam.status === 'PUBLISHED' || queryParam.status ==='DRAFT'" v-if="queryParam.status === 'PUBLISHED' || queryParam.status ==='DRAFT' || queryParam.status === 'INTIMATE'"
> >
<a <a
href="javascript:void(0);" href="javascript:void(0);"
@ -149,7 +149,18 @@
v-if="record.status=='PUBLISHED'" v-if="record.status=='PUBLISHED'"
> >
<a-tooltip <a-tooltip
placement="topLeft" placement="top"
:title="'点击访问【'+text+'】'"
>{{ text }}</a-tooltip>
</a>
<a
:href="options.blog_url+'/archives/'+record.url+'/password'"
target="_blank"
style="text-decoration: none;"
v-else-if="record.status == 'INTIMATE'"
>
<a-tooltip
placement="top"
:title="'点击访问【'+text+'】'" :title="'点击访问【'+text+'】'"
>{{ text }}</a-tooltip> >{{ text }}</a-tooltip>
</a> </a>
@ -250,7 +261,7 @@
<a <a
href="javascript:;" href="javascript:;"
@click="handleEditClick(post)" @click="handleEditClick(post)"
v-if="post.status === 'PUBLISHED' || post.status === 'DRAFT'" v-if="post.status === 'PUBLISHED' || post.status === 'DRAFT' || post.status === 'INTIMATE'"
>编辑</a> >编辑</a>
<a-popconfirm <a-popconfirm
:title="'你确定要发布【' + post.title + '】文章?'" :title="'你确定要发布【' + post.title + '】文章?'"
@ -269,7 +280,7 @@
@confirm="handleEditStatusClick(post.id,'RECYCLE')" @confirm="handleEditStatusClick(post.id,'RECYCLE')"
okText="确定" okText="确定"
cancelText="取消" cancelText="取消"
v-if="post.status === 'PUBLISHED' || post.status === 'DRAFT'" v-if="post.status === 'PUBLISHED' || post.status === 'DRAFT' || post.status === 'INTIMATE'"
> >
<a href="javascript:;">回收站</a> <a href="javascript:;">回收站</a>
</a-popconfirm> </a-popconfirm>

View File

@ -30,6 +30,12 @@
> >
<a-input v-model="selectedPost.url" /> <a-input v-model="selectedPost.url" />
</a-form-item> </a-form-item>
<a-form-item label="访问密码:">
<a-input
type="password"
v-model="selectedPost.password"
/>
</a-form-item>
<a-form-item label="发表时间:"> <a-form-item label="发表时间:">
<a-date-picker <a-date-picker

View File

@ -89,7 +89,7 @@
v-if="record.status=='PUBLISHED'" v-if="record.status=='PUBLISHED'"
> >
<a-tooltip <a-tooltip
placement="topLeft" placement="top"
:title="'点击访问【'+text+'】'" :title="'点击访问【'+text+'】'"
>{{ text }}</a-tooltip> >{{ text }}</a-tooltip>
</a> </a>

View File

@ -118,8 +118,11 @@
{{ item.commentCount }} {{ item.commentCount }}
</a> </a>
</span> </span>
<span v-if="item.type=='PRIVATE'"> <span v-if="item.type=='INTIMATE'">
<a href="javascript:void(0);" disabled> <a
href="javascript:void(0);"
disabled
>
<a-icon type="lock" /> <a-icon type="lock" />
</a> </a>
</span> </span>
@ -399,7 +402,7 @@ export default {
handleEdit(item) { handleEdit(item) {
this.title = '编辑' this.title = '编辑'
this.journal = item this.journal = item
this.isPublic = item.type !== 'PRIVATE' this.isPublic = item.type !== 'INTIMATE'
this.visible = true this.visible = true
// , // ,
// this.plusPhotoVisible = false // this.plusPhotoVisible = false
@ -442,7 +445,15 @@ export default {
createOrUpdateJournal() { createOrUpdateJournal() {
// //
// this.journal.photos = this.journalPhotos // 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) { if (this.journal.id) {
journalApi.update(this.journal.id, this.journal).then(response => { journalApi.update(this.journal.id, this.journal).then(response => {

View File

@ -377,7 +377,10 @@
label="Secret Key" label="Secret Key"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input v-model="options.oss_qiniu_secret_key" /> <a-input
type="password"
v-model="options.oss_qiniu_secret_key"
/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="Bucket" label="Bucket"
@ -424,7 +427,10 @@
label="Access Secret" label="Access Secret"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input v-model="options.oss_aliyun_access_secret" /> <a-input
type="password"
v-model="options.oss_aliyun_access_secret"
/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="图片处理策略:" label="图片处理策略:"
@ -465,7 +471,10 @@
label="Secret Key" label="Secret Key"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input v-model="options.bos_baiduyun_secret_key" /> <a-input
type="password"
v-model="options.bos_baiduyun_secret_key"
/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="图片处理策略:" label="图片处理策略:"
@ -513,7 +522,10 @@
label="Secret Key" label="Secret Key"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input v-model="options.cos_tencentyun_secret_key" /> <a-input
type="password"
v-model="options.cos_tencentyun_secret_key"
/>
</a-form-item> </a-form-item>
</div> </div>
<a-form-item> <a-form-item>
@ -571,6 +583,7 @@
> >
<a-input <a-input
v-model="options.email_password" v-model="options.email_password"
type="password"
placeholder="部分邮箱可能是授权码" placeholder="部分邮箱可能是授权码"
/> />
</a-form-item> </a-form-item>
@ -660,7 +673,10 @@
label="CDN 加速域名:" label="CDN 加速域名:"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input v-model="options.blog_cdn_domain" placeholder="请确保已经正确配置好了 CDN"/> <a-input
v-model="options.blog_cdn_domain"
placeholder="请确保已经正确配置好了 CDN"
/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="自定义 head" label="自定义 head"