feat:增加草稿博客功能
This commit is contained in:
@@ -1,26 +1,15 @@
|
||||
import { cloudService } from './index'
|
||||
import { IBlog, IBlogCategory, IBlogComment, IBlogStats, IBlogVisit, INewBlog, IQueryBlog } from '@/types/blog'
|
||||
import { IBlog, IBlogCategory, IBlogComment, IBlogStats, IBlogVisit, INewBlog } from '@/types/blog'
|
||||
|
||||
import qs from 'qs'
|
||||
import { IPageRecord } from '@/types'
|
||||
|
||||
export const queryBlogApi = (currentPage: number, pageSize: number): Promise<IPageRecord<IBlog>> =>
|
||||
cloudService({
|
||||
url: '/blog-api/blog/page',
|
||||
url: '/blog-api/blog/all/page',
|
||||
method: 'get',
|
||||
params: { currentPage, pageSize }
|
||||
})
|
||||
|
||||
export const queryBlogByConditionApi = (query: IQueryBlog): Promise<IBlog[]> =>
|
||||
cloudService({
|
||||
url: '/blog-api/blog/condition',
|
||||
method: 'get',
|
||||
params: query,
|
||||
paramsSerializer: (params) => {
|
||||
return qs.stringify(params, { arrayFormat: 'indices' })
|
||||
}
|
||||
})
|
||||
|
||||
export const queryBlogByIdApi = (id: number): Promise<IBlog> =>
|
||||
cloudService({
|
||||
url: `/blog-api/blog/${id}/content`,
|
||||
|
||||
Reference in New Issue
Block a user