diff --git a/src/routes/reg/SignInLink.tsx b/src/routes/reg/SignInLink.tsx index ac3359eb..4d10b4f6 100644 --- a/src/routes/reg/SignInLink.tsx +++ b/src/routes/reg/SignInLink.tsx @@ -1,3 +1,4 @@ +import { useEffect } from 'react'; import styled from "styled-components"; const StyledSignInLink = styled.ul` @@ -26,21 +27,23 @@ const StyledSignInLink = styled.ul` `; export default function SignInLink({ token }: { token?: string }) { - const isMobile = "ontouchstart" in document.documentElement; const handleSignIn = () => { location.href = "/#/login"; }; - const showAppEntry = isMobile && !!token; + useEffect(() => { + const isMobile = "ontouchstart" in document.documentElement; + // 直接跳转 + if (isMobile && !!token) { + location.href = `https://voce.chat/download?link=${encodeURIComponent(`${location.origin}?magic_token=${token}`)}`; + } + }, [token]); + return (
  • Have an account? Sign In
  • - {showAppEntry &&
  • - Using a mobile device? Open in - VoceChat App -
  • }
    ); }