feat: change post and sheet access url.

pull/3445/head
ruibaby 2020-02-11 12:15:48 +08:00
parent 93d53938bf
commit c524d43f9a
6 changed files with 17 additions and 25 deletions

View File

@ -56,13 +56,13 @@
<a <a
slot="description" slot="description"
target="_blank" target="_blank"
:href="options.blog_url+'/archives/'+comment.post.url" :href="comment.post.fullPath"
v-if="this.type=='posts'" v-if="this.type=='posts'"
>{{ comment.post.title }}</a> >{{ comment.post.title }}</a>
<a <a
slot="description" slot="description"
target="_blank" target="_blank"
:href="options.blog_url+'/s/'+comment.sheet.url" :href="comment.sheet.fullPath"
v-else-if="this.type=='sheets'" v-else-if="this.type=='sheets'"
>{{ comment.sheet.title }}</a> >{{ comment.sheet.title }}</a>
<span <span
@ -136,7 +136,6 @@ export default {
detailLoading: true, detailLoading: true,
editable: false, editable: false,
commentStatus: commentApi.commentStatus, commentStatus: commentApi.commentStatus,
options: [],
keys: ['blog_url'] keys: ['blog_url']
} }
}, },
@ -163,9 +162,6 @@ export default {
} }
} }
}, },
computed: {
...mapGetters(['options'])
},
watch: { watch: {
visible: function(newValue, oldValue) { visible: function(newValue, oldValue) {
this.$log.debug('old value', oldValue) this.$log.debug('old value', oldValue)

View File

@ -187,12 +187,12 @@
发表在 发表在
<a <a
v-if="type==='posts'" v-if="type==='posts'"
:href="options.blog_url+'/archives/'+item.post.url" :href="item.post.fullPath"
target="_blank" target="_blank"
>{{ item.post.title }}</a> >{{ item.post.title }}</a>
<a <a
v-if="type === 'sheets'" v-if="type === 'sheets'"
:href="options.blog_url+'/s/'+item.sheet.url" :href="item.sheet.fullPath"
target="_blank" target="_blank"
>{{ item.sheet.title }}</a> >{{ item.sheet.title }}</a>
</template> </template>
@ -282,14 +282,14 @@
v-if="type==='posts'" v-if="type==='posts'"
slot="post" slot="post"
slot-scope="post" slot-scope="post"
:href="options.blog_url+'/archives/'+post.url" :href="post.fullPath"
target="_blank" target="_blank"
>{{ post.title }}</a> >{{ post.title }}</a>
<a <a
v-if="type === 'sheets'" v-if="type === 'sheets'"
slot="sheet" slot="sheet"
slot-scope="sheet" slot-scope="sheet"
:href="options.blog_url+'/s/'+sheet.url" :href="sheet.fullPath"
target="_blank" target="_blank"
>{{ sheet.title }}</a> >{{ sheet.title }}</a>
<span <span
@ -561,8 +561,7 @@ export default {
comment.content = marked(comment.content) comment.content = marked(comment.content)
return comment return comment
}) })
}, }
...mapGetters(['options'])
}, },
methods: { methods: {
loadComments() { loadComments() {

View File

@ -124,7 +124,7 @@
<a <a
v-if="item.status=='PUBLISHED' || item.status == 'INTIMATE'" v-if="item.status=='PUBLISHED' || item.status == 'INTIMATE'"
slot="title" slot="title"
:href="options.blog_url+'/archives/'+item.url" :href="item.fullPath"
target="_blank" target="_blank"
>{{ item.title }}</a> >{{ item.title }}</a>
<a <a
@ -396,8 +396,7 @@ export default {
log.type = this.logType[log.type].text log.type = this.logType[log.type].text
return log return log
}) })
}, }
...mapGetters(['options'])
}, },
destroyed: function() { destroyed: function() {
if (this.logDrawerVisible) { if (this.logDrawerVisible) {

View File

@ -19,7 +19,7 @@
target="_blank" target="_blank"
>{{ item.author }}</a> 发表在 <a >{{ item.author }}</a> 发表在 <a
v-if="item.post.status=='PUBLISHED' || item.post.status=='INTIMATE'" v-if="item.post.status=='PUBLISHED' || item.post.status=='INTIMATE'"
:href="options.blog_url+'/archives/'+item.post.url" :href="item.post.fullPath"
target="_blank" target="_blank"
>{{ item.post.title }}</a><a >{{ item.post.title }}</a><a
v-else-if="item.post.status=='DRAFT'" v-else-if="item.post.status=='DRAFT'"
@ -40,7 +40,7 @@
target="_blank" target="_blank"
>{{ item.author }}</a> 发表在 <a >{{ item.author }}</a> 发表在 <a
v-if="item.sheet.status=='PUBLISHED'" v-if="item.sheet.status=='PUBLISHED'"
:href="options.blog_url+'/s/'+item.sheet.url" :href="item.sheet.fullPath"
target="_blank" target="_blank"
>{{ item.sheet.title }}</a><a >{{ item.sheet.title }}</a><a
v-else-if="item.sheet.status=='DRAFT'" v-else-if="item.sheet.status=='DRAFT'"
@ -101,8 +101,7 @@ export default {
comment.content = marked(comment.content) comment.content = marked(comment.content)
return comment return comment
}) })
}, }
...mapGetters(['options'])
}, },
created() { created() {
this.loadComments() this.loadComments()

View File

@ -237,7 +237,7 @@
/> />
<a <a
v-if="item.status=='PUBLISHED' || item.status == 'INTIMATE'" v-if="item.status=='PUBLISHED' || item.status == 'INTIMATE'"
:href="options.blog_url+'/archives/'+item.url" :href="item.fullPath"
target="_blank" target="_blank"
style="text-decoration: none;" style="text-decoration: none;"
> >
@ -318,7 +318,7 @@
/> />
<a <a
v-if="record.status=='PUBLISHED' || record.status == 'INTIMATE'" v-if="record.status=='PUBLISHED' || record.status == 'INTIMATE'"
:href="options.blog_url+'/archives/'+record.url" :href="record.fullPath"
target="_blank" target="_blank"
style="text-decoration: none;" style="text-decoration: none;"
> >
@ -620,8 +620,7 @@ export default {
post.statusProperty = this.postStatus[post.status] post.statusProperty = this.postStatus[post.status]
return post return post
}) })
}, }
...mapGetters(['options'])
}, },
created() { created() {
this.loadPosts() this.loadPosts()

View File

@ -247,7 +247,7 @@
> >
<a <a
v-if="item.status=='PUBLISHED'" v-if="item.status=='PUBLISHED'"
:href="options.blog_url+'/s/'+item.url" :href="item.fullPath"
target="_blank" target="_blank"
style="text-decoration: none;" style="text-decoration: none;"
> >
@ -298,7 +298,7 @@
> >
<a <a
v-if="record.status=='PUBLISHED'" v-if="record.status=='PUBLISHED'"
:href="options.blog_url+'/s/'+record.url" :href="record.fullPath"
target="_blank" target="_blank"
style="text-decoration: none;" style="text-decoration: none;"
> >