feat(cms): 添加导航批量导入导出功能

- 新增导航数据批量导入接口- 实现管理员专属的备份与恢复按钮- 增加搜索组件中的导出逻辑及弹窗控制
- 调整按钮布局并移除旧有功能入口 x- 引入lsx 库支持 Excel 文件读写操作
- 添加权限判断以限制敏感操作访问
This commit is contained in:
2025-10-10 23:17:51 +08:00
parent e8cd62f86b
commit 8a13915346
2 changed files with 134 additions and 20 deletions

View File

@@ -134,3 +134,18 @@ export async function getByCode(code: string) {
return Promise.reject(new Error(res.data.message));
}
/**
* 导航批量导入
*/
export async function importCmsNavigation(file: File) {
const formData = new FormData();
formData.append('file', file);
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/cms/cms-navigation/import',
formData
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}