添加草稿功能
This commit is contained in:
@ -161,7 +161,7 @@
|
||||
Icon(:icon='["fas", "chevron-right"]')
|
||||
modal(name='setting')
|
||||
div
|
||||
| ok
|
||||
| 此功能正在开发中,敬请期待。
|
||||
.vue-module-buttons
|
||||
button.vue-module-button(
|
||||
type='button',
|
||||
@ -175,8 +175,16 @@ import remark from 'remark'
|
||||
import strip from 'strip-markdown'
|
||||
|
||||
export default {
|
||||
async asyncData ({ route, app, $axios }) {
|
||||
const data = await $axios.$get(`/public/article/details?id=${route.params.id}`)
|
||||
async asyncData ({ route, app, $axios, redirect }) {
|
||||
let draftStr = ''
|
||||
if (route.query && route.query.draft === 'true') {
|
||||
draftStr = '&draft=true'
|
||||
}
|
||||
const data = await $axios.$get(`/public/article/details?id=${route.params.id}${draftStr}`)
|
||||
if (data.status === 404) {
|
||||
redirect('/404')
|
||||
return
|
||||
}
|
||||
const result = data.result
|
||||
result.post_date = app.$moment(result.post_date).utc().format('lll')// 格式化时间
|
||||
// 热度值计算
|
||||
|
Reference in New Issue
Block a user