From fb28fd2e1524ac12565560a60a515e6952301b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=8B?= <94534613+BoyYangzai@users.noreply.github.com> Date: Wed, 21 Jun 2023 18:52:21 +0800 Subject: [PATCH] docs: update version href logic (#43144) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: update version href logic * chore: format --------- Co-authored-by: 洋 --- .dumi/theme/slots/Header/index.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.dumi/theme/slots/Header/index.tsx b/.dumi/theme/slots/Header/index.tsx index eb68d66192..629e84f376 100644 --- a/.dumi/theme/slots/Header/index.tsx +++ b/.dumi/theme/slots/Header/index.tsx @@ -215,11 +215,10 @@ const Header: React.FC = () => { } // Mirror url must have `/`, we add this for compatible const urlObj = new URL(currentUrl.replace(window.location.origin, url)); - if (urlObj.host === '3x.ant.design' || urlObj.host === '4x.ant.design') { - window.location.href = urlObj.href.replace(/\/$/, ''); - return; + if (urlObj.host.includes('antgroup')) { + window.location.href = `${urlObj.href.replace(/\/$/, '')}/`; } - window.location.href = `${urlObj.href.replace(/\/$/, '')}/`; + window.location.href = urlObj.href.replace(/\/$/, ''); }, []); const onLangChange = useCallback(() => {