/** * 当前页下载附件 */ export const downLoadFile =(alifileName,fileName) =>{ const servicesUrl = getSession("servicesUrl"); const sys_source = getSession("sysSource"); const author = getSession("author"); const url = servicesUrl+"common/downloadfile"; const data = { "Authorization":author, "sys_source":sys_source, "alifileName":alifileName, "fileName":fileName } const body = document.getElementsByTagName('body')[0]; const form = document.createElement('form'); form.method = 'POST'; form.action = url; for (let key in data) { let param = document.createElement('input'); param.type = 'hidden'; param.name = key; param.value = data[key]; form.appendChild(param); } body.appendChild(form); form.submit(); body.removeChild(form); }