2025-03-26
This commit is contained in:
39
src/api/modules/banner.ts
Normal file
39
src/api/modules/banner.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import http from "@/api";
|
||||
const B = `/banner/items`;
|
||||
//分页
|
||||
export const getBannerListApi = (params: any) => {
|
||||
return http.get<any>(`${B}/index`, params);
|
||||
};
|
||||
//新增
|
||||
export const getBannerListSaveApi = (params: any) => {
|
||||
console.log("1232323");
|
||||
return http.post<any>(`${B}/save`, params, {
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
}
|
||||
});
|
||||
};
|
||||
//更新
|
||||
export const getBannerUpApi = (params: any) => {
|
||||
const { id } = params;
|
||||
return http.put<any>(`${B}/update/${id}`, params);
|
||||
};
|
||||
//详情
|
||||
export const getBannerReadApi = (params: any) => {
|
||||
return http.get<any>(`${B}/read/${params}`);
|
||||
};
|
||||
//删除
|
||||
export const getBannerDelApi = (params: any) => {
|
||||
return http.delete<any>(`${B}/delete/${params}`);
|
||||
};
|
||||
//排序
|
||||
export const getBannerListSortApi = (params: any) => {
|
||||
const { id, sort } = params;
|
||||
return http.post<any>(`${B}/sort/${id}`, { sort });
|
||||
};
|
||||
//导出
|
||||
export const getBannerListExportApi = (params: any) => {
|
||||
return http.get<any>(`${B}/export`, params, {
|
||||
responseType: "arraybuffer"
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user