diff --git a/src/routes/reg/SignInLink.tsx b/src/routes/reg/SignInLink.tsx index de0ad0c1..52a75c27 100644 --- a/src/routes/reg/SignInLink.tsx +++ b/src/routes/reg/SignInLink.tsx @@ -1,14 +1,10 @@ import { useEffect } from 'react'; import { useTranslation } from 'react-i18next'; -import { useNavigate } from 'react-router-dom'; +import { NavLink } from 'react-router-dom'; import { isMobile } from '../../common/utils'; export default function SignInLink({ token }: { token?: string }) { const { t } = useTranslation("auth"); - const navigate = useNavigate(); - const handleSignIn = () => { - navigate("/login"); - }; useEffect(() => { // 移动端访问,则跳转 if (isMobile() && !!token) { @@ -19,7 +15,7 @@ export default function SignInLink({ token }: { token?: string }) { return (
); } diff --git a/src/routes/reg/index.tsx b/src/routes/reg/index.tsx index b5854c3f..b46ecbef 100644 --- a/src/routes/reg/index.tsx +++ b/src/routes/reg/index.tsx @@ -1,6 +1,12 @@ +import { useEffect } from "react"; import { Outlet } from "react-router-dom"; export default function RegContainer() { + useEffect(() => { + // 重新组织url + location.href = `${location.origin}${location.hash}${location.search}`; + }, [location]); + return (