|
@@ -1,34 +1,53 @@
|
|
|
-import { delete0, get, post } from '@/utils/request'
|
|
|
|
|
|
|
+import { delete0, get, post, postForm } from '@/utils/request'
|
|
|
|
|
|
|
|
const blogApi = {
|
|
const blogApi = {
|
|
|
- getBlogPost: '/api/blog/post',
|
|
|
|
|
- getBlogCategory: '/api/blog/category',
|
|
|
|
|
- getBlogTag: '/api/blog/tag',
|
|
|
|
|
- getBlogArchive: '/api/blog/archive',
|
|
|
|
|
- getBlogAbout: '/api/blog/about',
|
|
|
|
|
- getSearchList: '/api/blog/search'
|
|
|
|
|
|
|
+ getPost: '/api/blog/post',
|
|
|
|
|
+ getCategory: '/api/blog/category',
|
|
|
|
|
+ getTag: '/api/blog/tag',
|
|
|
|
|
+ getArchive: '/api/blog/archive',
|
|
|
|
|
+ getAbout: '/api/blog/about',
|
|
|
|
|
+ getSearchList: '/api/blog/search',
|
|
|
|
|
+ getBlogTag: '/api/blog/v2/tag',
|
|
|
|
|
+ getBlogCategory: '/api/blog/v2/category'
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export function getBlogPostList(pn) {
|
|
|
|
|
- return get(blogApi.getBlogPost + '/list?pn=' + pn)
|
|
|
|
|
|
|
+export function getPostList(pn) {
|
|
|
|
|
+ return get(blogApi.getPost + '/list?pn=' + pn)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export function getBlogPost(postId) {
|
|
|
|
|
- return get(blogApi.getBlogPost + '/detail?articleId=' + postId)
|
|
|
|
|
|
|
+export function getPost(postId) {
|
|
|
|
|
+ return get(blogApi.getPost + '/detail?articleId=' + postId)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export function getBlogTag(queryInfo) {
|
|
|
|
|
- return get(blogApi.getBlogTag, queryInfo)
|
|
|
|
|
|
|
+export function getTag(queryInfo) {
|
|
|
|
|
+ return get(blogApi.getTag, queryInfo)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export function getTagPost(queryInfo) {
|
|
export function getTagPost(queryInfo) {
|
|
|
- return get(blogApi.getBlogTag + '/post', queryInfo)
|
|
|
|
|
|
|
+ return get(blogApi.getTag + '/post', queryInfo)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export function getBlogArchive() {
|
|
|
|
|
- return get(blogApi.getBlogArchive)
|
|
|
|
|
|
|
+export function getArchive() {
|
|
|
|
|
+ return get(blogApi.getArchive)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export function getBlogAbout() {
|
|
|
|
|
- return get(blogApi.getBlogAbout)
|
|
|
|
|
|
|
+export function getAbout() {
|
|
|
|
|
+ return get(blogApi.getAbout)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// blog 后台接口
|
|
|
|
|
+export function getBlogTagList() {
|
|
|
|
|
+ return get(blogApi.getBlogTag + '/list')
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export function getBlogCategoryList() {
|
|
|
|
|
+ return get(blogApi.getBlogCategory + '/list')
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export function addBlogCategory(formData) {
|
|
|
|
|
+ return postForm(blogApi.getBlogCategory + '/add', formData)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export function deleteBlogCategory(formData) {
|
|
|
|
|
+ return postForm(blogApi.getBlogCategory + '/delete', formData)
|
|
|
}
|
|
}
|