const beforeupload = async (rawFile) => {
filetype.value = rawFile.name.substring(rawFile.name.lastIndexOf('.') + 1)
if (filetype.value == 'docx' || filetype.value == 'doc') {
// ;async () => {
const res = await PatentOfficeService.ConvertWordToPDF({
file: rawFile,//将file对象传过去
})
newPath.value = res.data
return false
}
const ConvertWordToPDF = async (file: any) => {
const formData = new FormData() //上传文件必须用formdata
formData.append('file', new Blob([file.file]))//变成二进制然后必须加中括号跟取最里
//层的file对象
const res = await axios.post<any, any>(
'/api/PatentServicesController/ConvertWordToPDF',
formData,
{
headers: {
'Content-Type':
'multipart/form-data; boundary=--------------------------202516566847018785837625',
},
},
)
const p = { newPath: res.data.data }
const re = await axios.post<any, any>(FIVE_UPLOAD_URL, p, {
headers: {
'Content-Type':
'multipart/form-data; boundary=--------------------------202516566847018785837625',
},
})
return re
}
07-09
6004
02-23
4064
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交