blog機能完成

This commit is contained in:
simple321vip
2022-05-02 22:10:20 +08:00
parent 91ee8a9577
commit 0a2c848fa0
10 changed files with 254 additions and 80 deletions
+11 -13
View File
@@ -1,19 +1,8 @@
import request from '../utils/request'
import Qs from 'qs'
const headers = {
'Content-Type': 'application/json;charsetset=UTF-8'
}
const get_blogs = (params: Object) => {
return request({
url: '/blog',
method: 'GET',
params: params,
paramsSerializer: (params) => {
return Qs.stringify(params, { arrayFormat: 'repeat' })
},
})
}
const listAll = () => {
return request({
@@ -40,6 +29,15 @@ const putBlogType = (data: Object) => {
})
}
const removeBlogType = (data: Object) => {
return request({
url: '/author/blog_type',
method: 'DELETE',
headers: headers,
data: data
})
}
const getContent = (id: string) => {
return request({
url: '/author/blog/content/' + id,
@@ -68,11 +66,11 @@ const updateContent = (postData: Object) => {
const deleteContent = (bid: string) => {
return request({
url: '/author/blog/content/' + bid,
url: '/author/blog/' + bid,
method: 'DELETE',
headers: headers,
})
}
export { get_blogs, listAll, updateBtName, putBlogType, getContent, putBlog, updateContent, deleteContent }
export { listAll, updateBtName, putBlogType, removeBlogType, getContent, putBlog, updateContent, deleteContent }