docs: fix 4x url (#46498)

This commit is contained in:
MadCcc 2023-12-18 11:03:24 +08:00 committed by GitHub
parent b7cf72d7cb
commit 89e5c0c30b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -223,9 +223,11 @@ 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.includes('antgroup')) {
window.location.href = `${urlObj.href.replace(/\/$/, '')}/`;
urlObj.pathname = `${urlObj.pathname.replace(/\/$/, '')}/`;
window.location.href = urlObj.toString();
} else {
window.location.href = urlObj.href.replace(/\/$/, '');
}
window.location.href = urlObj.href.replace(/\/$/, '');
}, []);
const onLangChange = useCallback(() => {