blog機能完成
This commit is contained in:
+11
-13
@@ -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 }
|
||||
Reference in New Issue
Block a user