/**
* 上传文件
*
* @param {Object} data
* @param {File} data.file
*/
export const putFileAttach = (data) => {
const {file, attachType, foreignKey, fieldName, tableName} = data;
const formData = new FormData();
formData.append("file", file, file.name);
formData.append("attachType", attachType);
formData.append("foreignKey", foreignKey);
formData.append("fieldName", fieldName);
formData.append("tableName", tableName);
return request({
url: 'xxxxx',
method: 'post',
data: formData
});
};```
上传文件,form
于 2022-05-25 16:37:46 首次发布