| | |
| | | } |
| | | |
| | | const openFile=(file: string)=>{ |
| | | axios.get(import.meta.env.VITE_API_URL + file,{headers:{'Content-Type': 'application/json','Authorization': `${Cookies.get('token')}`,'uid':`${Cookies.get('uid')}`},responseType: 'blob'}).then(res=>{ |
| | | if (res) { |
| | | const link = document.createElement('a') |
| | | let blob = new Blob([res.data],{type: 'application/pdf'}) |
| | | link.style.display = "none"; |
| | | link.href = URL.createObjectURL(blob); // 创建URL |
| | | window.open(link.href) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件读取失败' |
| | | }); |
| | | } |
| | | }) |
| | | // axios.get(file,{headers:{'Content-Type': 'application/json','Authorization': `${Cookies.get('token')}`,'uid':`${Cookies.get('uid')}`},responseType: 'blob'}).then(res=>{ |
| | | // if (res) { |
| | | // const link = document.createElement('a') |
| | | // let blob = new Blob([res.data],{type: 'application/pdf'}) |
| | | // link.style.display = "none"; |
| | | // link.href = URL.createObjectURL(blob); // 创建URL |
| | | // window.open(link.href) |
| | | // } else { |
| | | // ElMessage({ |
| | | // type: 'warning', |
| | | // message: '文件读取失败' |
| | | // }); |
| | | // } |
| | | // }) |
| | | window.open(file) |
| | | } |
| | | |
| | | // 删除用户 |