const uploadDocument= async function (documentPath, publishUrl) {
try {
const form = new FormData();
const documentStream = fs.createReadStream(path.resolve(documentPath));
form.append('file', documentStream);
const formHeaders = form.getHeaders();
axios.post(publishUrl, form, {
headers: {
...formHeaders,
},
})
.then(response => response)
.catch(error => error)
} catch (error) {
console.error('上传失败', error);
throw error;
}
}