系统数据迁移(系统基础数据导出、导入)功能开发
This commit is contained in:
45
src/api/system/dataMigration/index.ts
Normal file
45
src/api/system/dataMigration/index.ts
Normal file
@ -0,0 +1,45 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { ErrorMessageMode } from '/#/axios';
|
||||
|
||||
enum Api {
|
||||
ExportDatas= '/system/dataMigration/exportDatas',
|
||||
DownloadDatas='/system/dataMigration/downloadDatas',
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 系统配置迁移-导出资源
|
||||
*/
|
||||
export async function exportDatas(params, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.post(
|
||||
{
|
||||
url: Api.ExportDatas,
|
||||
data:params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description: 根据uuid(目录名称)下载数据
|
||||
*/
|
||||
export async function downloadDatas(
|
||||
params?: object,
|
||||
mode: ErrorMessageMode = 'modal'
|
||||
) {
|
||||
return defHttp.download(
|
||||
{
|
||||
url: Api.DownloadDatas+"/"+params.uuid,
|
||||
method: 'GET',
|
||||
responseType: 'blob',
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user