42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import http from "@/api";
|
|
// import qs from "qs";
|
|
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);
|
|
};
|
|
//文章分类删除
|
|
export const getArticleClassDelApi = (params: any) => {
|
|
return http.delete<any>(`${ARTICLE_CATEGORY}/delete/${params}`);
|
|
};
|
|
//文章分类更新(用于编辑后)
|
|
export const getArticleClassEditUpApi = (params: any) => {
|
|
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
|
|
});
|
|
};
|
|
//文章分类详情(用于编辑)
|
|
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 });
|
|
};
|