feat:增加草稿博客功能

This commit is contained in:
2025-10-23 19:55:51 +08:00
parent b9c6d883e5
commit 4d52c2ae82
6 changed files with 25 additions and 24 deletions

View File

@@ -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 {