本文参考:https://www.cnblogs.com/webbest/p/10107697.html
const postDownloadFile = (action, param) => {
const form = document.createElement('form');
form.action = action;
form.method = 'post';
form.target = 'blank';
Object.keys(param).forEach((item) => {
const input = document.createElement('input');
input.type = 'hidden';
input.name = item;
input.value = param[item];
form.appendChild(input);
});
document.body.appendChild(form);
form.submit();
document.body.removeChild(form);
}
postDownloadFile(url, param);