diff --git a/src/api/path/infra.api.ts b/src/api/path/infra.api.ts index ee85c21..e2e9d94 100644 --- a/src/api/path/infra.api.ts +++ b/src/api/path/infra.api.ts @@ -3,9 +3,9 @@ import { httpErrorHandle } from '@/utils' import { RequestHttpEnum, ModuleTypeEnum, ContentTypeEnum } from '@/enums/httpEnum' // * 上传文件 -export const uploadFile = async (data: object) => { +export const uploadFile = async (data: object,upData: object) => { try { - const res = await http(RequestHttpEnum.POST)(`${ModuleTypeEnum.INFRA}/file/upload`, data, ContentTypeEnum.FORM_DATA) + const res = await http(RequestHttpEnum.POST)(`${ModuleTypeEnum.INFRA}/file/upload?tableId=${upData.tableId}&tableName=${upData.tableName}`, data, ContentTypeEnum.FORM_DATA) return res } catch { httpErrorHandle() diff --git a/src/views/chart/ContentConfigurations/components/CanvasPage/index.vue b/src/views/chart/ContentConfigurations/components/CanvasPage/index.vue index 865aae4..16cde1c 100644 --- a/src/views/chart/ContentConfigurations/components/CanvasPage/index.vue +++ b/src/views/chart/ContentConfigurations/components/CanvasPage/index.vue @@ -282,7 +282,12 @@ const customRequest = (options: UploadCustomRequestOptions) => { ) let uploadParams = new FormData() uploadParams.append('file', newNameFile) - const uploadRes = await uploadFile(uploadParams) + const upData = { + tableId: fetchRouteParamsLocation(), + tableName: 'reportGoViewProject', + } + + const uploadRes = await uploadFile(uploadParams, upData) if(uploadRes && uploadRes.code === ResultEnum.SUCCESS) { chartEditStore.setEditCanvasConfig(