From be59e56bd1273ea3008002099094a48a2a8789aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=91=E5=85=88=E6=A3=AE?= Date: Tue, 12 Nov 2024 12:12:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=86=E4=BA=AB?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=9C=89=E4=B8=AD=E6=96=87=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pages/index.vue b/pages/index.vue index 7037fec..8ffd36f 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -825,9 +825,11 @@ } if (command === "share_config") { try { - await writeText(btoa(JSON.stringify({ config: mainStore.config }))); + const WT = btoa(encodeURIComponent(JSON.stringify({ config: mainStore.config }))) + await writeText(WT); ElMessage.success("配置已复制"); } catch (err) { + console.log(err); ElMessage.error("分享失败"); } } @@ -843,7 +845,7 @@ confirmButtonText: "确定", cancelButtonText: "取消" }); - const payload = JSON.parse(atob(importConfigData.data)); + const payload = JSON.parse(decodeURIComponent(atob(importConfigData.data))); mainStore.$patch(payload); ElMessage.success("导入成功"); importConfigData.visible = false;