【JavasSript】后台返回 csv base64 下载
const exort = async () => {
try {
const { data } = await zhjxDownloadFile({
meta: {
user_token: localStorage.getItem('user_token'),
file_name: activeName.value,
image_indexs: activePage.value,
},
});
let uri = 'data:text/csv;base64,' + data.csv;
const a = document.createElement('a');
a.download = `${activeName.value.replace('.pdf', '')}-page${activePage.value}.csv`;
a.href = uri;
a.click();
ElMessage.success('导出成功');
} catch (error) {}
};