2025-03-26

This commit is contained in:
2025-03-26 11:00:21 +08:00
parent 927d7381b8
commit b45f4950d3
468 changed files with 54473 additions and 124 deletions

29
src/api/modules/QAList.ts Normal file
View File

@@ -0,0 +1,29 @@
import http from "@/api";
const QA = `/faq`;
//列表
export const getQAListApi = (params: any) => {
return http.get<any>(`${QA}/index`, params);
};
//详情
export const getQAListDetailsApi = (params: any) => {
return http.get<any>(`${QA}/read/${params}`);
};
//删除
export const getQAListDelApi = (params: any) => {
return http.delete<any>(`${QA}/delete/${params}`);
};
//更新
export const getQAListEditUpApi = (params: any) => {
const { id } = params;
return http.put<any>(`${QA}/update/${id}`, params);
};
//新增
export const getQAListSaveApi = (params: any) => {
return http.post<any>(`${QA}/save`, params);
};
//排序
export const getQASortApi = (params: any) => {
return http.post<any>(`${QA}/sort/${params.id}`, { sort: params.sort });
};

16
src/api/modules/agent.ts Normal file
View File

@@ -0,0 +1,16 @@
import http from "@/api";
const G = `/agent`;
// 联系我们列表
export const getAgentListApi = (params: any) => {
return http.get<any>(`${G}/index`, params);
};
//导出
export const getAgentListExportApi = (params: any) => {
return http.get<any>(`${G}/export`, params, {
responseType: "arraybuffer"
});
};
//代理企业规模
export const getAgentTypesListApi = () => {
return http.get<any>(`${G}/enterprise_size_types`);
};

View File

@@ -0,0 +1,32 @@
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 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, seo_title, seo_keywords, seo_desc } = params;
return http.put<any>(`/article/category/update/${id}`, {
name,
sort,
is_show,
seo_title,
seo_keywords,
seo_desc
});
};
//文章分类详情(用于编辑)
export const getArticleClassDetailsApi = (params: any) => {
return http.get<any>(`${ARTICLE_CATEGORY}/read/${params}`);
};

View File

@@ -0,0 +1,39 @@
import http from "@/api";
const ARTICLE = `article`;
//文章列表
export const getArticleListApi = (params: any) => {
return http.get<any>(`${ARTICLE}/index`, params);
};
//文章分类接口
export const getArticleClassDataApi = (params?: any) => {
return http.get<any>(`${ARTICLE}/categorys`, params);
};
//文章删除接口
export const getArticleListDelApi = (params: any) => {
return http.delete<any>(`${ARTICLE}/delete/${params}`);
};
//文章导出
// responseType: 'arraybuffer' 表示期望服务器返回的数据类型为 ArrayBuffer。
// ArrayBuffer 是一个用于存储二进制数据的对象,当服务器返回的数据是二进制数据(如文件数据,包括 Excel 文件、图片文件等)时,将 responseType 设置为 arraybuffer 可以正确地接收和处理这些二进制数据。
// 在处理文件下载(例如,从服务器下载 Excel 文件)时,使用 arraybuffer 可以确保接收到的数据是二进制形式,以便后续操作,如将其转换为 Blob 对象进行文件下载。
export const getArticleListExportApi = (params: any) => {
return http.get<any>(`${ARTICLE}/export`, params, {
responseType: "arraybuffer"
});
};
//文章更新
export const getArticleListUpApi = (params: any) => {
const { id } = params;
delete params.id;
return http.put<any>(`${ARTICLE}/update/${id}`, params);
};
//文章分类新增
export const getArticleListAddSaveApi = (params: any) => {
return http.post<any>(`${ARTICLE}/save`, params);
};
//文章详情
export const getArticleListDetailsApi = (params: any) => {
return http.get<any>(`${ARTICLE}/read/${params}`);
};

View File

@@ -0,0 +1,14 @@
import http from "@/api";
const ARTICLE_TRASH = `article/trash`;
//文章回收站列表接口
export const getArticleTrashListApi = (params: any) => {
return http.get<any>(`${ARTICLE_TRASH}/index`, params);
};
//文章回收站删除接口
export const getArticleTrashDelApi = (params: any) => {
return http.delete<any>(`${ARTICLE_TRASH}/delete/${params}`);
};
//文章回收站恢复接口
export const getArticleTrashRestoreApi = (params: any) => {
return http.get<any>(`${ARTICLE_TRASH}/restore/${params}`);
};

View File

@@ -0,0 +1,20 @@
import http from "@/api";
const ARTICLE_MESSAGE = `/article/message`;
//文章评论列表
export const getArticleRemarkListApi = (params: any) => {
return http.get<any>(`${ARTICLE_MESSAGE}/index`, params);
};
//文章评论审核接口
export const getArticleRemarkExamineApi = (params: any) => {
return http.get<any>(`${ARTICLE_MESSAGE}/audit/${params}`);
};
//文章评论删除接口
export const getArticleRemarkDelApi = (params: any) => {
return http.delete<any>(`${ARTICLE_MESSAGE}/delete/${params}`);
};
//
export const getArticleRemarkExportApi = (params: any) => {
return http.get<any>(`${ARTICLE_MESSAGE}/export`, params, {
responseType: "arraybuffer"
});
};

39
src/api/modules/banner.ts Normal file
View 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"
});
};

View File

@@ -0,0 +1,23 @@
import http from "@/api";
const BC = `/banner`;
//分页
export const getBannerClassListApi = (params: any) => {
return http.get<any>(`${BC}/index`, params);
};
//新增
export const getBannerClassListSaveApi = (params: any) => {
return http.post<any>(`${BC}/save`, params);
};
//更新
export const getBannerClassListUpApi = (params: any) => {
const { id } = params;
return http.put<any>(`${BC}/update/${id}`, params);
};
//详情
export const getBannerClassListReadApi = (params: any) => {
return http.get<any>(`${BC}/read/${params}`);
};
//删除
export const getBannerClassListDelApi = (params: any) => {
return http.delete<any>(`${BC}/delete/${params}`);
};

View File

@@ -0,0 +1,35 @@
import http from "@/api";
const CONFIG = `/config`;
//配置列表分页
export const getConfigListApi = (params: any) => {
return http.get<any>(`${CONFIG}/index`, params);
};
//配置新增
export const getConfigSaveApi = (params: any) => {
return http.post<any>(`${CONFIG}/save`, params);
};
//配置更新
export const getConfigUpApi = (params: any) => {
const { id } = params;
return http.put<any>(`${CONFIG}/update/${id}`, params);
};
//配置详情
export const getConfigReadApi = (params: any) => {
return http.get<any>(`${CONFIG}/read/${params}`);
};
//配置删除
export const getConfigDelApi = (params: any) => {
return http.delete<any>(`${CONFIG}/delete/${params}`);
};
//分组 getConfigGroupsApi getConfigTypesApi
export const getConfigGroupsApi = () => {
return http.get<any>(`${CONFIG}/groups`);
};
//分类
export const getConfigTypesApi = () => {
return http.get<any>(`${CONFIG}/types`);
};
// export const getConfigListApi = (params: any) => {
// return http.get<any>(`${CONFIG}/index`, params);
// };

View File

@@ -0,0 +1,12 @@
import http from "@/api";
const L = `/leavemsg`;
// 联系我们列表
export const getLeaveMsgListApi = (params: any) => {
return http.get<any>(`${L}/index`, params);
};
//导出 getLeaveMsgListExportApi getLeaveMsgListApi
export const getLeaveMsgListExportApi = (params: any) => {
return http.get<any>(`${L}/export`, params, {
responseType: "arraybuffer"
});
};

View File

@@ -0,0 +1,31 @@
import http from "@/api";
///admin/v1/attachment/category/read/{id}
const ATT_C = `/attachment/category`;
// 下载分类分页列表
export const getCategoryListApi = (params: any) => {
return http.get<any>(`${ATT_C}/index`, params);
};
//下载分类详情
export const getCategoryReadApi = (params: any) => {
return http.get<any>(`${ATT_C}/read/${params}`);
};
//下载分类保存
export const getCategorySaveApi = (params: any) => {
return http.post<any>(`${ATT_C}/save`, params);
};
//下载分类更新
export const getCategoryUpdateApi = (params: any) => {
return http.put<any>(`${ATT_C}/update/${params.id}`, params);
};
//下载分类删除
export const getCategoryDelApi = (params: any) => {
return http.delete<any>(`${ATT_C}/delete/${params}`);
};
//下载分类排序
export const getCategorySortApi = (params: any) => {
return http.post<any>(`${ATT_C}/sort/${params.id}`, { sort: params.sort });
};
//下载分类下拉列表
export const getCategorysApi = () => {
return http.get<any>(`/attachment/categorys`);
};

View File

@@ -0,0 +1,39 @@
import http from "@/api";
const ATT = `/attachment`;
// 下载管理分页列表
export const getAttachmentListApi = (params: any) => {
return http.get<any>(`${ATT}/index`, params);
};
//下载管理详情
export const getAttachmentReadApi = (params: any) => {
return http.get<any>(`${ATT}/read/${params}`);
};
//下载管理保存
export const getAttachmentSaveApi = (params: any) => {
return http.post<any>(`${ATT}/save`, params, {
headers: {
"Content-Type": "application/x-www-form-urlencoded"
}
});
};
//下载管理更新
export const getAttachmentUpdateApi = (params: any) => {
return http.put<any>(`${ATT}/update/${params.id}`, params);
};
//下载管理删除
export const getAttachmentListDelApi = (params: any) => {
return http.delete<any>(`${ATT}/delete/${params}`);
};
//下载管理排序
export const getAttachmentSortApi = (params: any) => {
return http.post<any>(`${ATT}/sort/${params.id}`, { sort: params.sort });
};
//下载管理启动禁止
export const getAttachmentEnableApi = (params: any) => {
return http.get<any>(`${ATT}/enable/${params}`);
};
//下载管理附件上传
export const getAttachmentUpFileApi = (params: any) => {
return http.post<any>(`${ATT}/upload`, params);
};
///attachment/upload

View File

@@ -0,0 +1,14 @@
import http from "@/api";
const ATT_T = `/attachment/trash`;
// 下载回收站分页列表
export const getAttachmentTrashListApi = (params: any) => {
return http.get<any>(`${ATT_T}/index`, params);
};
// 下载回收站分页列表
export const getAttachmentTrashRestoreApi = (params: any) => {
return http.get<any>(`${ATT_T}/restore/${params}`);
};
//下载回收站删除
export const getAttachmentTrashDelApi = (params: any) => {
return http.delete<any>(`${ATT_T}/delete/${params}`);
};

14
src/api/modules/global.ts Normal file
View File

@@ -0,0 +1,14 @@
import http from "@/api";
//语言列表
export const getLanguageListApi = () => {
return http.get<any>(`/language/list`);
};
//语言切换
export const getLanguageCutoverApi = (params: any) => {
return http.get<any>(`/language/cutover/${params}`);
};
//国家 country/list
export const getCountryListApi = (params: any) => {
return http.get<any>(`/country/list`, params);
};

14
src/api/modules/home.ts Normal file
View File

@@ -0,0 +1,14 @@
import http from "@/api";
const USER = `/user`;
// 路由
export const getProductPlatformsListApi = () => {
return http.get<any>(`${USER}/params/menu`);
};
//
export const getSystemInfoApi = () => {
return http.get<any>(`system/info`);
};
//获取官网各模块的url
export const getSystemUrlsApi = (params?: any) => {
return http.get<any>(`system/urls`, params);
};

5
src/api/modules/log.ts Normal file
View File

@@ -0,0 +1,5 @@
import http from "@/api";
// 日志
export const getLogsListApi = (params: any) => {
return http.get<any>(`/logs/operate/index`, params);
};

37
src/api/modules/login.ts Normal file
View File

@@ -0,0 +1,37 @@
import { ResultData, Login } from "@/api/interface/index";
//import authMenuList from "@/assets/json/authMenuList.json";
import http from "@/api";
// const USER = `/user`;
/**
* @name 登录模块
*/
// 用户登录
export const loginApi = (params: Login.ReqLoginCode) => {
return http.post<ResultData<Login.ResLogin>>(`/user/login`, params, {
noLoading: true
});
// 正常 post json 请求 ==> application/json
// return http.post<Login.ResLogin>(PORT1 + `/login`, params, { noLoading: true }); // 控制当前请求不显示 loading
// return http.post<Login.ResLogin>(PORT1 + `/login`, {}, { params }); // post 请求携带 query 参数 ==> ?username=admin&password=123456
// return http.post<Login.ResLogin>(PORT1 + `/login`, qs.stringify(params)); // post 请求携带表单参数 ==> application/x-www-form-urlencoded
// return http.get<Login.ResLogin>(PORT1 + `/login?${qs.stringify(params, { arrayFormat: "repeat" })}`); // get 请求可以携带数组等复杂参数
};
export const loginCodeImgApi = (params?: any) => {
return http.get<ResultData<Login.ResLogin>>(`/user/captcha`, params, {
noLoading: true
});
};
// 获取菜单列表
export const getAuthMenuListApi = (params: any) => {
// return http.get<any>(`/Login/Menus`, {}, { noLoading: true });
// console.log(params);
// return authMenuList;
return http.get<any>(`/user/${params}/menu`, {}, { noLoading: true });
};
// 用户退出登录
export const logoutApi = () => {
return http.get(`/user/logout`);
};

31
src/api/modules/nav.ts Normal file
View File

@@ -0,0 +1,31 @@
import http from "@/api";
const ITEMS = `/navigation/items`;
// 导航列表列接口
export const getItemsListApi = (params: any) => {
return http.get<any>(`${ITEMS}/index`, params);
};
// 导航链接类型接口
export const getItemsLinkTypeApi = (params: any) => {
return http.get<any>(`${ITEMS}/link/type`, params);
};
// 导航详情接口
export const getItemsReadApi = (params: any) => {
return http.get<any>(`${ITEMS}/read/${params}`);
};
// 导航新增接口
export const getItemsSaveApi = (params: any) => {
return http.post<any>(`${ITEMS}/save`, params);
};
// 导航更新接口
export const getItemsListEditUpApi = (params: any) => {
const { id } = params;
return http.put<any>(`${ITEMS}/update/${id}`, params);
};
// 导航排序接口
export const getItemsSortApi = (params: any) => {
return http.post<any>(`${ITEMS}/sort/${params.id}`, { sort: params.sort });
};
// 导航删除接口
export const getItemsDelApi = (params: any) => {
return http.delete<any>(`${ITEMS}/delete/${params}`);
};

View File

@@ -0,0 +1,27 @@
import http from "@/api";
const NAV_CLASS = `/navigation`;
// 导航栏类型接口
export const getNavClassListApi = () => {
return http.get<any>(`${NAV_CLASS}/list`);
};
//列表
export const getNavClassListIndexApi = (params: any) => {
return http.get<any>(`${NAV_CLASS}/index`, params);
};
// 导航详情接口
export const getNavClassListReadApi = (params: any) => {
return http.get<any>(`${NAV_CLASS}/read/${params}`);
};
// 导航新增接口
export const getNavClassListSaveApi = (params: any) => {
return http.post<any>(`${NAV_CLASS}/save`, params);
};
// 导航更新接口
export const getNavClassListEditUpApi = (params: any) => {
const { id } = params;
return http.put<any>(`${NAV_CLASS}/update/${id}`, params);
};
// 导航删除接口
export const getNavClassListDelApi = (params: any) => {
return http.delete<any>(`${NAV_CLASS}/delete/${params}`);
};

View File

@@ -0,0 +1,6 @@
import http from "@/api";
const P = `/product/inquiry`;
// 联系我们列表
export const getProductListApi = (params: any) => {
return http.get<any>(`${P}/index`, params);
};

View File

@@ -0,0 +1,30 @@
import http from "@/api";
const PRODUCT_ATTR = `/product/attr`;
// 产品属性列表
export const getProductAttrListApi = (params: any) => {
return http.get<any>(`${PRODUCT_ATTR}/index`, params);
};
// 产品属性详情
export const getProductAttrDetailsApi = (params: any) => {
return http.get<any>(`${PRODUCT_ATTR}/read/${params}`);
};
// 产品属性删除
export const getProductAttrDelApi = (params: any) => {
return http.delete<any>(`${PRODUCT_ATTR}/delete/${params}`);
};
// 产品属性更新
export const getProductAttrUpApi = (params: any) => {
const { id } = params;
return http.put<any>(`${PRODUCT_ATTR}/update/${id}`, params);
};
//产品属性新增
export const getProductAttrAddApi = (params: any) => {
return http.post<any>(`${PRODUCT_ATTR}/save`, params, {
headers: {
"Content-Type": "application/x-www-form-urlencoded"
}
});
};
//

View File

@@ -0,0 +1,36 @@
import http from "@/api";
const PRODUCT_CATEGORY = `/product/category`;
//产品分类树接口
export const getProductCategoryListApi = (params: any) => {
return http.get<any>(`${PRODUCT_CATEGORY}/index`, params);
};
//产品分类详情接口
export const getProductClassCategoryReadApi = (params: any) => {
return http.get<any>(`${PRODUCT_CATEGORY}/read/${params}`);
};
//产品分类新增接口
export const getArticleCategorySaveApi = (params: any) => {
return http.post<any>(`${PRODUCT_CATEGORY}/save`, params);
};
// 产品分类更新
export const getProductCategoryUpdateApi = (params: any) => {
const { id } = params;
return http.put<any>(`${PRODUCT_CATEGORY}/update/${id}`, params);
};
// 产品分类删除
export const getProductCategoryDelApi = (params: any) => {
return http.delete<any>(`${PRODUCT_CATEGORY}/delete/${params}`);
};
//产品分类排序
export const getArticleCategorySortApi = (params: any) => {
const { id, sort } = params;
return http.post<any>(`${PRODUCT_CATEGORY}/sort/${id}`, { sort });
};
//成本系统
export const getProductClassTcoTreeApi = () => {
return http.get<any>(`${PRODUCT_CATEGORY}/tco/tree`);
};
export const getProductClassCategoryShowApi = (params: any) => {
return http.get<any>(`${PRODUCT_CATEGORY}/show/${params}`);
};

View File

@@ -0,0 +1,8 @@
// import http from "@/api";
import productEdit from "@/assets/json/productEdit.json";
// 获取菜单列表
export const getProductEditRuleFormApi = () => {
// return http.get<any>(`/Login/Menus`, {}, { noLoading: true });
return productEdit;
};

View File

@@ -0,0 +1,25 @@
import http from "@/api";
const PRODUCT_BUYPASS = `/product/buypass`;
// 产品购买平台列表接口(下拉列表)
export const getProductPlatformsListApi = () => {
return http.get<any>(`${PRODUCT_BUYPASS}/platforms`);
};
// 产品购买平台列表接口
export const getProductBuypassListApi = (params: any) => {
return http.get<any>(`${PRODUCT_BUYPASS}/index`, params);
};
//导出
export const getProductBuypassListExportApi = (params: any) => {
return http.get<any>(`${PRODUCT_BUYPASS}/export`, params, {
responseType: "arraybuffer"
});
};
//导入
export const getProductBuypassListImportApi = (params: any) => {
return http.post<any>(`${PRODUCT_BUYPASS}/import`, params);
};
// 更新
export const getProductBuypassUpdateApi = (params: any) => {
const { id, param } = params;
return http.put<any>(`${PRODUCT_BUYPASS}/update/${id}`, param);
};

View File

@@ -0,0 +1,38 @@
import http from "@/api";
const PRODUCT = `/product`;
// 产品列表
export const getProductListApi = (params: any) => {
return http.get<any>(`${PRODUCT}/index`, params);
};
// 产品详情
export const getProductDetailsApi = (params: any) => {
return http.get<any>(`${PRODUCT}/read/${params}`);
};
// 产品列表删除
export const getProductDelApi = (params: any) => {
return http.delete<any>(`${PRODUCT}/delete/${params}`);
};
// 产品列表上下架
export const getProductUpOrShelvesApi = (params: any) => {
return http.get<any>(`${PRODUCT}/updown_shelves/${params}`);
};
// 产品列表详情
export const getProductEditUpApi = (params: any) => {
const { id } = params;
return http.put<any>(`${PRODUCT}/update/${id}`, params);
};
// 产品属性特征列表
export const getProductAttrsListApi = () => {
return http.get<any>(`${PRODUCT}/attrs`);
};
// 导出
export const getProductListExportApi = (params: any) => {
return http.get<any>(`${PRODUCT}/export`, params, {
responseType: "arraybuffer"
});
};
//产品列表排序
export const getProductListSortApi = (params: any) => {
const { id, sort } = params;
return http.post<any>(`${PRODUCT}/sort/${id}`, { sort });
};

View File

@@ -0,0 +1,14 @@
import http from "@/api";
const PRODUCT_TRASH = `/product/trash`;
// 产品回收列表
export const getProductTrashListApi = (params: any) => {
return http.get<any>(`${PRODUCT_TRASH}/index`, params);
};
// 产品回收恢复
export const getProductTrashRestoreApi = (params: any) => {
return http.get<any>(`${PRODUCT_TRASH}/restore/${params}`);
};
// 产品回收删除
export const getProductTrashDelApi = (params: any) => {
return http.delete<any>(`${PRODUCT_TRASH}/delete/${params}`);
};

View File

@@ -0,0 +1,16 @@
import http from "@/api";
const BP = `/bp/inquiry`;
// 列表
export const getBPListApi = (params: any) => {
return http.get<any>(`${BP}/index`, params);
};
//导出
export const getBPListExportApi = (params: any) => {
return http.get<any>(`${BP}/export`, params, {
responseType: "arraybuffer"
});
};
//选品列表
export const getBPInterestedListApi = (params?: any) => {
return http.get<any>(`${BP}/interested`, params);
};

View File

@@ -0,0 +1,29 @@
import http from "@/api";
const ROLE = `/role`;
// 角色列表
export const getRoleListApi = (params: any) => {
return http.get<any>(`${ROLE}/index`, params);
};
// 角色详情
export const getRoleListDetailsApi = (params: any) => {
return http.get<any>(`${ROLE}/read/${params}`);
};
// 角色列表删除
export const getRoleListDelApi = (params: any) => {
return http.delete<any>(`${ROLE}/delete/${params}`);
};
// 角色列表更新
export const getRoleListEditUpApi = (params: any) => {
const { id } = params;
return http.put<any>(`${ROLE}/update/${id}`, params);
};
//角色列表新增
export const getRoleListSaveApi = (params: any) => {
return http.post<any>(`${ROLE}/save`, params);
};
//角色列表接口
export const getRolesListApi = () => {
return http.get<any>(`roles`);
};

10
src/api/modules/set.ts Normal file
View File

@@ -0,0 +1,10 @@
import http from "@/api";
const SET = `/site/config`;
//获取站点配置
export const getSetListApi = () => {
return http.get<any>(`${SET}/index`);
};
//更新站点配置
export const getConfigUpApi = (params: any) => {
return http.put<any>(`${SET}/update`, params);
};

21
src/api/modules/upload.ts Normal file
View File

@@ -0,0 +1,21 @@
import { Upload } from "@/api/interface/index";
// import { useRouter } from "vue-router";
import http from "@/api";
// const $router = useRouter();
// const routeName: string = $router.currentRoute.value.name as string;
// const routerObj: any = {
// articleEditIndex: "article"
// };
/**
* @name 文件上传模块
*/
// 图片上传
export const uploadImg = (params: any, name?: any) => {
return http.post<any>(`/images/${name}/upload`, params);
};
// 视频上传
export const uploadVideo = (params: FormData, name?: any) => {
return http.post<Upload.ResFileUrl>(`video/${name}/upload`, params);
};

View File

@@ -0,0 +1,25 @@
import http from "@/api";
const USER = `/user`;
// 用户列表
export const getUserListApi = (params: any) => {
return http.get<any>(`${USER}/index`, params);
};
// 用户详情
export const getUserListDetailsApi = (params: any) => {
return http.get<any>(`${USER}/read/${params}`);
};
// 用户列表删除
export const getUserListDelApi = (params: any) => {
return http.delete<any>(`${USER}/delete/${params}`);
};
// 用户列表更新
export const getUserListEditUpApi = (params: any) => {
const { id } = params;
return http.put<any>(`${USER}/update/${id}`, params);
};
//用户列表新增
export const getUserListSaveApi = (params: any) => {
return http.post<any>(`${USER}/save`, params);
};

View File

@@ -0,0 +1,26 @@
import http from "@/api";
const VIDEO_CATEGORY = `video/category`;
// 视频分类分页列表
export const getVideoClassListApi = (params: any) => {
return http.get<any>(`${VIDEO_CATEGORY}/index`, params);
};
//视频分类详情
export const getVideoClassReadApi = (params: any) => {
return http.get<any>(`${VIDEO_CATEGORY}/read/${params}`);
};
//视频分类保存
export const getVideoClassSaveApi = (params: any) => {
return http.post<any>(`${VIDEO_CATEGORY}/save`, params);
};
//视频分类更新
export const getVideoClassUpdateApi = (params: any) => {
return http.put<any>(`${VIDEO_CATEGORY}/update/${params.id}`, params);
};
//视频分类删除
export const getVideoClassListDelApi = (params: any) => {
return http.delete<any>(`${VIDEO_CATEGORY}/delete/${params}`);
};
//视频分类排序
export const getVideoClassSortApi = (params: any) => {
return http.post<any>(`${VIDEO_CATEGORY}/sort/${params.id}`, { sort: params.sort });
};

View File

@@ -0,0 +1,28 @@
import http from "@/api";
const VIDEO = `/video`;
// 视频分页列表
export const getVideoListApi = (params: any) => {
return http.get<any>(`${VIDEO}/index`, params);
};
//视频详情
export const getVideoReadApi = (params: any) => {
return http.get<any>(`${VIDEO}/read/${params}`);
};
//视频保存
export const getVideoSaveApi = (params: any) => {
return http.post<any>(`${VIDEO}/save`, params);
};
//视频更新
export const getVideoUpdateApi = (params: any) => {
return http.put<any>(`${VIDEO}/update/${params.id}`, params);
};
//视频删除
export const getVideoListDelApi = (params: any) => {
return http.delete<any>(`${VIDEO}/delete/${params}`);
};
//视频导出
export const getVideoListExportApi = (params: any) => {
return http.get<any>(`${VIDEO}/export`, params, {
responseType: "arraybuffer"
});
};

View File

@@ -0,0 +1,14 @@
import http from "@/api";
const VIDEO_TRASH = `/video/trash`;
// 视频回收分页列表
export const getVideoTrashListApi = (params: any) => {
return http.get<any>(`${VIDEO_TRASH}/index`, params);
};
// 视频回收站恢复
export const getVideoTrashRestoreApi = (params: any) => {
return http.get<any>(`${VIDEO_TRASH}/restore/${params}`);
};
//视频回收站删除
export const getVideoTrashListDelApi = (params: any) => {
return http.delete<any>(`${VIDEO_TRASH}/delete/${params}`);
};

View File

@@ -0,0 +1,44 @@
import http from "@/api";
const MENUS = `/menus`;
const MENU = "/menu";
// 菜单树形
export const getRoleMenusListApi = () => {
return http.get<any>(`${MENUS}`);
};
//树状列表
export const getMenusListApi = (params: any) => {
return http.get<any>(`${MENU}/index`, params);
};
//删除
export const getMenusListDelApi = (params: any) => {
return http.delete<any>(`${MENU}/delete/${params}`);
};
// 详情
export const getMenusListDetailsApi = (params: any) => {
return http.get<any>(`${MENU}/read/${params}`);
};
//更新
export const getMenusListUpApi = (params: any) => {
const { id } = params;
return http.put<any>(`${MENU}/update/${id}`, params);
};
//新增
export const getMenusLisSaveApi = (params: any) => {
return http.post<any>(`${MENU}/save`, params);
};
//导出
export const getMenusLisExportApi = (params: any) => {
return http.get<any>(`${MENU}/export`, params, {
responseType: "arraybuffer"
});
};
//导入
export const getMenusLisImportApi = (params: any) => {
return http.post<any>(`${MENU}/import`, params);
};
//排序
export const getMenusLisSortApi = (params: any) => {
const { id, sort } = params;
return http.post<any>(`${MENU}/sort/${id}`, { sort });
};