From e8034334fb91698e4007508c826a9398f3ba54ef Mon Sep 17 00:00:00 2001 From: shuai Date: Mon, 10 Apr 2023 11:19:43 +0800 Subject: [PATCH 1/2] fix: params value --- ui/src/router/pathFactory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/router/pathFactory.ts b/ui/src/router/pathFactory.ts index e26636aa..acf6b690 100644 --- a/ui/src/router/pathFactory.ts +++ b/ui/src/router/pathFactory.ts @@ -20,7 +20,7 @@ const tagEdit = (tagId: string) => { const questionLanding = (questionId: string, slugTitle: string = '') => { const { seo } = seoSettingStore.getState(); if (!questionId) { - return slugTitle ? `/questions/null/slugTitle` : '/questions/null'; + return slugTitle ? `/questions/null/${slugTitle}` : '/questions/null'; } // @ts-ignore if (/[13]/.test(seo.permalink) && slugTitle) { From 81d58431d5dd0d3a06aeeeff8f412058bb7b2835 Mon Sep 17 00:00:00 2001 From: shuai Date: Mon, 10 Apr 2023 16:25:12 +0800 Subject: [PATCH 2/2] fix: link nofollow --- ui/src/components/Customize/index.tsx | 2 +- ui/src/components/Editor/utils/index.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/src/components/Customize/index.tsx b/ui/src/components/Customize/index.tsx index 0570d19f..8f99cc05 100644 --- a/ui/src/components/Customize/index.tsx +++ b/ui/src/components/Customize/index.tsx @@ -32,7 +32,7 @@ const ActivateScriptNodes = (el, part) => { scriptList.push(node); } } - scriptList.forEach((so) => { + scriptList?.forEach((so) => { const script = document.createElement('script'); script.text = so.text; for (let i = 0; i < so.attributes.length; i += 1) { diff --git a/ui/src/components/Editor/utils/index.ts b/ui/src/components/Editor/utils/index.ts index 8bf393fb..7f8f80f6 100644 --- a/ui/src/components/Editor/utils/index.ts +++ b/ui/src/components/Editor/utils/index.ts @@ -146,7 +146,8 @@ export function htmlRender(el: HTMLElement | null) { el.querySelectorAll('a').forEach((a) => { const base = window.location.origin; const targetUrl = new URL(a.href, base); - if (targetUrl.toString() !== window.location.href) { + + if (targetUrl.origin !== base) { a.rel = 'nofollow'; } });