Browse Source

chore: remove / from old version url (#43117)

pull/43128/head
afc163 1 year ago
committed by GitHub
parent
commit
9c4b20d5eb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      .dumi/theme/slots/Header/index.tsx

8
.dumi/theme/slots/Header/index.tsx

@ -213,11 +213,13 @@ const Header: React.FC = () => {
.replace(/\/$/, ''); .replace(/\/$/, '');
return; return;
} }
// Mirror url must have `/`, we add this for compatible // Mirror url must have `/`, we add this for compatible
const urlObj = new URL(currentUrl.replace(window.location.origin, url)); const urlObj = new URL(currentUrl.replace(window.location.origin, url));
urlObj.pathname = `${urlObj.pathname.replace(/\/$/, '')}/`; if (urlObj.host === '3x.ant.design' || urlObj.host === '4x.ant.design') {
window.location.href = urlObj.href; window.location.href = urlObj.href.replace(/\/$/, '');
return;
}
window.location.href = `${urlObj.href.replace(/\/$/, '')}/`;
}, []); }, []);
const onLangChange = useCallback(() => { const onLangChange = useCallback(() => {

Loading…
Cancel
Save