docs: update version href logic (#43144)

* docs: update version href logic

* chore: format

---------

Co-authored-by: 洋 <hetongyang@bytedance.com>
This commit is contained in:
2023-06-21 18:52:21 +08:00 committed by GitHub
parent ec29ebf2c9
commit fb28fd2e15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(() => {