feat:增加草稿博客功能
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
} from '@/types/blog'
|
||||
import {
|
||||
addBlogApi, addBlogCommentApi, deleteBlogApi,
|
||||
queryBlogApi, queryBlogByConditionApi, queryBlogByIdApi,
|
||||
queryBlogApi, queryBlogByIdApi,
|
||||
queryBlogCategoryApi, queryBlogCommentApi, queryBlogStatsApi, queryLatestBlogApi, updateBlogApi
|
||||
} from '@/apis/blog.ts'
|
||||
import { IHandleApi } from 'vue3-common/types'
|
||||
@@ -51,7 +51,8 @@ export const useBlogStore = defineStore('blog', {
|
||||
topValue: 1,
|
||||
isGreat: false,
|
||||
category: '',
|
||||
content: ''
|
||||
content: '',
|
||||
isApproved: 0
|
||||
} as INewBlog,
|
||||
blogCategoryList: [] as IBlogCategory[],
|
||||
blogStats: {} as IBlogStats,
|
||||
@@ -74,9 +75,6 @@ export const useBlogStore = defineStore('blog', {
|
||||
this.blogList = result.records
|
||||
this.pageInfo.totalSize = result.total
|
||||
},
|
||||
async queryBlogByCondition(query: IQueryBlog) {
|
||||
this.blogList = await queryBlogByConditionApi(query)
|
||||
},
|
||||
async queryBlogById(id: number) {
|
||||
this.currentBlog = await queryBlogByIdApi(id)
|
||||
await this.queryBlogComment(this.currentBlogId)
|
||||
@@ -133,7 +131,8 @@ export const useBlogStore = defineStore('blog', {
|
||||
content: '',
|
||||
isGreat: false,
|
||||
title: '',
|
||||
topValue: 0
|
||||
topValue: 0,
|
||||
isApproved: 0
|
||||
}
|
||||
},
|
||||
getEmptyBlogComment(): IBlogComment {
|
||||
|
||||
Reference in New Issue
Block a user