home页兼容H5,以及默认跳转/home

This commit is contained in:
北枳 2025-10-21 20:16:23 +08:00
parent e33fa3c26f
commit e21fb53fe5
7 changed files with 10 additions and 10 deletions

View File

@ -176,11 +176,11 @@ export default function OAuthCallback() {
localStorage.setItem('token', token);
}
console.log('⏰ 准备在2秒后跳转到 /movies');
console.log('⏰ 准备在2秒后跳转到 /home');
// 2秒后跳转到主页
setTimeout(() => {
const returnUrl = '/movies';
const returnUrl = '/home';
console.log('🚀 开始跳转到:', returnUrl);
window.location.href = returnUrl;
}, 2000);

View File

@ -42,7 +42,7 @@ const FamousTemplate: React.FC = () => {
<h2 data-alt="famous-template-title" className="text-xl py-4 font-semibold text-white">
Hot Templates
</h2>
<div data-alt="template-tabs" className="flex items-center gap-2 ml-4">
<div data-alt="template-tabs" className="flex flex-wrap items-center gap-2 ml-4">
{(["all", "music", "animation", "fantasy"] as const).map((tab) => (
<button
key={tab}

View File

@ -30,7 +30,7 @@ interface CurrentUserMinimal {
/**
*
* - LOGO '/' Signup + homeTabs /
* - LOGO '/movies' +
* - LOGO '/home' +
*/
export default function H5TopBar({ onSelectHomeTab }: H5TopBarProps) {
const router = useRouter();
@ -148,7 +148,7 @@ export default function H5TopBar({ onSelectHomeTab }: H5TopBarProps) {
const handleLogoClick = () => {
if (isLogin) {
router.push('/movies');
router.push('/home');
} else {
router.push('/');
}

View File

@ -280,7 +280,7 @@ export function TopBar({ collapsed, isDesktop=true }: { collapsed: boolean, isDe
px-2 py-1.5 text-xs
/* 平板及以上适配 */
sm:px-4 sm:py-2 sm:text-sm"
onClick={() => router.push("/movies")}
onClick={() => router.push("/home")}
>
Go Started
</div>
@ -523,7 +523,7 @@ export function TopBar({ collapsed, isDesktop=true }: { collapsed: boolean, isDe
px-2 py-1.5 text-xs
/* 平板及以上适配 */
sm:px-4 sm:py-2 sm:text-sm"
onClick={() => router.push("/movies")}
onClick={() => router.push("/home")}
>
Go Started
</div>

View File

@ -382,7 +382,7 @@ function HomeModule1() {
2xl:w-[12rem] 2xl:h-[3.75rem] 2xl:text-xl"
onClick={() => {
if (localStorage.getItem("token")) {
router.push("/movies");
router.push("/home");
} else {
router.push("/login");
}

View File

@ -133,7 +133,7 @@ export default function Login() {
try {
await loginUser(email, password);
// 登录成功后跳转到首页
router.push("/movies");
router.push("/home");
} catch (error: any) {
console.error("Login failed:", error);

View File

@ -291,7 +291,7 @@ const handleOAuthCallback = async () => {
// 2秒后跳转到主页
setTimeout(() => {
const returnUrl = '/movies'
const returnUrl = '/home'
window.location.href = returnUrl
}, 2000)
} catch (error) {