From d74b2766ba9fe23811651110f795504bc238a908 Mon Sep 17 00:00:00 2001 From: Nut He <18328704+hetao92@users.noreply.github.com> Date: Thu, 17 Feb 2022 11:53:55 +0800 Subject: [PATCH] fix: fix env check & encode bug --- app/config/explore.ts | 3 +-- scripts/rpm/preinst.sh | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/app/config/explore.ts b/app/config/explore.ts index 33b483aa..b6f4e09c 100644 --- a/app/config/explore.ts +++ b/app/config/explore.ts @@ -169,10 +169,9 @@ export const downloadCSVFiles = ({ headers, tables, title }) => { navigator.msSaveBlob(csvData, `test.csv`); } else { // Non-Internet Explorer - const csvContent = 'data:text/csv;charset=utf-8,\uFEFF' + result; // Use the download property of the A tag to implement the download function const link = document.createElement('a'); - link.href = encodeURI(csvContent); + link.href = 'data:text/csv;charset=utf-8,\uFEFF' + encodeURIComponent(result); link.download = `${title}.csv`; document.body.appendChild(link); link.click(); diff --git a/scripts/rpm/preinst.sh b/scripts/rpm/preinst.sh index 56f22b89..77a64134 100644 --- a/scripts/rpm/preinst.sh +++ b/scripts/rpm/preinst.sh @@ -2,8 +2,4 @@ if ! type "lsof" > /dev/null; then echo -e "\e[31mInstall failed for the reason: the command lsof required\e[0m" exit 1 -fi -if ! type "node" > /dev/null; then - echo -e "\e[31mInstall failed for the reason: the nodejs(>v10.16.0) required\e[0m" - exit 1 -fi +fi \ No newline at end of file