From d4b6cc5e4d4ff8bd7d444dbb33adb5aafc08d025 Mon Sep 17 00:00:00 2001 From: whyour Date: Thu, 13 Oct 2022 23:39:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B0=83=E8=AF=95=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E9=80=89=E6=8B=A9=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/config/index.tsx | 1 + src/pages/log/index.tsx | 1 + src/pages/script/editModal.tsx | 9 +++++++++ src/pages/script/index.tsx | 6 +++++- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/pages/config/index.tsx b/src/pages/config/index.tsx index ecd2ebf6..6cfb44aa 100644 --- a/src/pages/config/index.tsx +++ b/src/pages/config/index.tsx @@ -80,6 +80,7 @@ const Config = () => { loading={loading} extra={[ { isPhone ? [ { + setLog(''); if (currentNode) { setCNode(currentNode); setValue(content as string); setSelectedKey(currentNode.key); + const newMode = LangMap[value.slice(-3)] || ''; + setLanguage(newMode); } }, [content, currentNode]); @@ -150,6 +158,7 @@ const EditModal = ({ title={ <> { const getDetail = (node: any) => { request - .get(`${config.apiPrefix}scripts/${node.title}?path=${node.parent || ''}`) + .get( + `${config.apiPrefix}scripts/${encodeURIComponent(node.title)}?path=${ + node.parent || '' + }`, + ) .then(({ code, data }) => { if (code === 200) { setValue(data);