feat: 🚀 文章分类

This commit is contained in:
2025-04-11 10:54:56 +08:00
parent 473aa04ea4
commit bbf953f47a
10 changed files with 156 additions and 63 deletions

View File

@@ -5,6 +5,10 @@ const ARTICLE_CATEGORY = `/article/category`;
export const getArticleClassListApi = (params: any) => {
return http.get<any>(`${ARTICLE_CATEGORY}/index`, params);
};
//文章分类下拉框
export const getArticleClassApi = () => {
return http.get<any>(`/article/categorys`);
};
//文章分类新增
export const getArticleClassAddSaveApi = (params: any) => {
return http.post<any>(`${ARTICLE_CATEGORY}/save`, params);
@@ -15,12 +19,13 @@ export const getArticleClassDelApi = (params: any) => {
};
//文章分类更新(用于编辑后)
export const getArticleClassEditUpApi = (params: any) => {
const { id, name, sort, is_show, seo_title, seo_keywords, seo_desc } = params;
const { id, name, sort, is_show, pid, seo_title, seo_keywords, seo_desc } = params;
return http.put<any>(`/article/category/update/${id}`, {
name,
sort,
is_show,
pid,
seo_title,
seo_keywords,
seo_desc
@@ -30,3 +35,7 @@ export const getArticleClassEditUpApi = (params: any) => {
export const getArticleClassDetailsApi = (params: any) => {
return http.get<any>(`${ARTICLE_CATEGORY}/read/${params}`);
};
export const getArticleClassSortApi = (params: any) => {
const { id, sort } = params;
return http.post<any>(`${ARTICLE_CATEGORY}/sort/${id}`, { sort });
};