//文件上传
afterRead(file) {
console.log(file);
this.show = true;
let fd = new FormData();
fd.append("file", file.file);
axios
.post(
`${window.webConfig.defultJavaFilePath}/file/uploads/serviceAnnex/0`,
fd,
{
headers: {
"Content-Type": "multipart/form-data",
},
}
)
.then((res) => {
this.show = false;
if (res.data.statusCode == "200") {
let url = res.data.resMap.fileIdList[0];
this.fileList.push({
fileUrl: FILE_OPEN_URL() + url,
fileId: url,
fileName: file.file.name.split(".")[0],
fileType:
file.file.name.split(".")[file.file.name.split(".").length - 1],
remark: "",
});
}
})
.catch((err) => {});
},
网友评论