feat:增加日志管理模块

This commit is contained in:
2025-10-28 16:21:00 +08:00
parent 570406309e
commit 0053d6c3e0
9 changed files with 139 additions and 6 deletions

View File

@@ -1,12 +1,13 @@
import { defineStore } from 'pinia'
import {
IAlterLog,
IBlog, IBlogCategory, IBlogComment,
IBlogLatest, IBlogNestedComment, IBlogStats, INewBlog, IQueryBlog
} from '@/types/blog'
import {
addBlogApi,
addBlogCommentApi,
deleteBlogApi,
deleteBlogApi, queryBlogAlterApi,
queryBlogApi,
queryBlogByIdApi,
queryBlogCategoryApi,
@@ -27,6 +28,7 @@ export const useBlogStore = defineStore('blog', {
unapprovedBlogList: [] as IBlog[],
blogCommentList: [] as IBlogComment[],
blogNestedCommentList: [] as IBlogNestedComment[],
alterLogList: [] as IAlterLog[],
currentBlogComment: {
id: 0,
blogId: 0,
@@ -88,6 +90,9 @@ export const useBlogStore = defineStore('blog', {
async queryUnapprovedBlogList() {
this.unapprovedBlogList = await queryUnapprovedBlogApi()
},
async queryBlogAlterLogList() {
this.alterLogList = await queryBlogAlterApi('puppy-service')
},
async queryBlogById(id: number) {
this.currentBlog = await queryBlogByIdApi(id)
await this.queryBlogComment(this.currentBlogId)