From 6465a77744e520460b2a4f16639097e1cd163172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=BF=83=E5=AE=87?= Date: Sat, 13 Jan 2024 09:51:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9node=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppConfig.js | 1 - src/common/UrlTool.js | 12 ++++++------ src/components/render-html.jsx | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index f79c518b0..8212b42e3 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -98,7 +98,6 @@ export function initAxiosInterceptors(props) { if (response.data.status === 404) { let responseURL = (response && response.request) ? response.request.responseURL:''; // 组织和个人的拥有情况,404不跳转 - console.log(responseURL) if (responseURL.indexOf('/api/users/') === -1 && responseURL.indexOf('/api/organizations/') === -1 ) { // 邀请页面不进行404跳转 if( window.location.pathname.includes('/invite') && (responseURL.includes('/simple.json')||responseURL.includes('/detail.json')||responseURL.includes('/menu_list.json'))){ diff --git a/src/common/UrlTool.js b/src/common/UrlTool.js index 256f1fa15..b38ae1bd4 100644 --- a/src/common/UrlTool.js +++ b/src/common/UrlTool.js @@ -295,13 +295,13 @@ export function turnbar(str){ let s = str; if(s && s.length>0){ if(s.indexOf("%")>-1){ - s = s.replaceAll('%','_25'); + s = s.split('%').join('_25'); } if(s.indexOf("#")>-1){ - s = s.replaceAll('#','%23'); + s = s.split('#').join('%23'); } if(s.indexOf("/")>-1){ - s = s.replaceAll('/','%2F'); + s = s.split('/').join('%2F'); } } return s; @@ -310,13 +310,13 @@ export function returnbar(str){ let s = str; if(s && s.length>0){ if(str.indexOf("_25")>-1){ - s = s.replaceAll('_25','%'); + s = s.split('_25').join('%'); } if(s.indexOf("%23")>-1){ - s = s.replaceAll('%23','#'); + s = s.split('%23').join('#'); } if(s.indexOf("%2F")>-1){ - s = s.replaceAll('%2F','/'); + s = s.split('%2F').join('/'); } } return s; diff --git a/src/components/render-html.jsx b/src/components/render-html.jsx index b8e9aad77..391c1e37b 100644 --- a/src/components/render-html.jsx +++ b/src/components/render-html.jsx @@ -94,7 +94,7 @@ export default ({ for(var x=0;x#${item.project_issues_index}:${item.subject}` : `#${item.project_issues_index}(已删除)`; - rs = rs.replaceAll(`#${item.project_issues_index}`,content); + rs = rs.split(`#${item.project_issues_index}`).join(content); } } @@ -103,7 +103,7 @@ export default ({ return renderToString(_unescape(expression) || '', { displayMode: type === 'block', throwOnError: false, output: 'html' }) }) rs = dompurify.sanitize(rs.replace(/▁/g, "▁▁▁")) - rs = rs.replaceAll('