forked from 77media/video-flow
home页兼容H5,以及默认跳转/home
This commit is contained in:
parent
e33fa3c26f
commit
e21fb53fe5
@ -176,11 +176,11 @@ export default function OAuthCallback() {
|
|||||||
localStorage.setItem('token', token);
|
localStorage.setItem('token', token);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('⏰ 准备在2秒后跳转到 /movies');
|
console.log('⏰ 准备在2秒后跳转到 /home');
|
||||||
|
|
||||||
// 2秒后跳转到主页
|
// 2秒后跳转到主页
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const returnUrl = '/movies';
|
const returnUrl = '/home';
|
||||||
console.log('🚀 开始跳转到:', returnUrl);
|
console.log('🚀 开始跳转到:', returnUrl);
|
||||||
window.location.href = returnUrl;
|
window.location.href = returnUrl;
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
|||||||
@ -42,7 +42,7 @@ const FamousTemplate: React.FC = () => {
|
|||||||
<h2 data-alt="famous-template-title" className="text-xl py-4 font-semibold text-white">
|
<h2 data-alt="famous-template-title" className="text-xl py-4 font-semibold text-white">
|
||||||
Hot Templates
|
Hot Templates
|
||||||
</h2>
|
</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) => (
|
{(["all", "music", "animation", "fantasy"] as const).map((tab) => (
|
||||||
<button
|
<button
|
||||||
key={tab}
|
key={tab}
|
||||||
|
|||||||
@ -30,7 +30,7 @@ interface CurrentUserMinimal {
|
|||||||
/**
|
/**
|
||||||
* 移动端顶栏(抽屉式菜单)
|
* 移动端顶栏(抽屉式菜单)
|
||||||
* - 未登录:左 LOGO → '/',右侧 Signup + 菜单;抽屉显示 homeTabs 与 登录/注册
|
* - 未登录:左 LOGO → '/',右侧 Signup + 菜单;抽屉显示 homeTabs 与 登录/注册
|
||||||
* - 已登录:左 LOGO → '/movies',右侧 升级图标 + 菜单;抽屉显示 用户卡片、快捷充值、入口与登出
|
* - 已登录:左 LOGO → '/home',右侧 升级图标 + 菜单;抽屉显示 用户卡片、快捷充值、入口与登出
|
||||||
*/
|
*/
|
||||||
export default function H5TopBar({ onSelectHomeTab }: H5TopBarProps) {
|
export default function H5TopBar({ onSelectHomeTab }: H5TopBarProps) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -148,7 +148,7 @@ export default function H5TopBar({ onSelectHomeTab }: H5TopBarProps) {
|
|||||||
|
|
||||||
const handleLogoClick = () => {
|
const handleLogoClick = () => {
|
||||||
if (isLogin) {
|
if (isLogin) {
|
||||||
router.push('/movies');
|
router.push('/home');
|
||||||
} else {
|
} else {
|
||||||
router.push('/');
|
router.push('/');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -280,7 +280,7 @@ export function TopBar({ collapsed, isDesktop=true }: { collapsed: boolean, isDe
|
|||||||
px-2 py-1.5 text-xs
|
px-2 py-1.5 text-xs
|
||||||
/* 平板及以上适配 */
|
/* 平板及以上适配 */
|
||||||
sm:px-4 sm:py-2 sm:text-sm"
|
sm:px-4 sm:py-2 sm:text-sm"
|
||||||
onClick={() => router.push("/movies")}
|
onClick={() => router.push("/home")}
|
||||||
>
|
>
|
||||||
Go Started
|
Go Started
|
||||||
</div>
|
</div>
|
||||||
@ -523,7 +523,7 @@ export function TopBar({ collapsed, isDesktop=true }: { collapsed: boolean, isDe
|
|||||||
px-2 py-1.5 text-xs
|
px-2 py-1.5 text-xs
|
||||||
/* 平板及以上适配 */
|
/* 平板及以上适配 */
|
||||||
sm:px-4 sm:py-2 sm:text-sm"
|
sm:px-4 sm:py-2 sm:text-sm"
|
||||||
onClick={() => router.push("/movies")}
|
onClick={() => router.push("/home")}
|
||||||
>
|
>
|
||||||
Go Started
|
Go Started
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -382,7 +382,7 @@ function HomeModule1() {
|
|||||||
2xl:w-[12rem] 2xl:h-[3.75rem] 2xl:text-xl"
|
2xl:w-[12rem] 2xl:h-[3.75rem] 2xl:text-xl"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (localStorage.getItem("token")) {
|
if (localStorage.getItem("token")) {
|
||||||
router.push("/movies");
|
router.push("/home");
|
||||||
} else {
|
} else {
|
||||||
router.push("/login");
|
router.push("/login");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -133,7 +133,7 @@ export default function Login() {
|
|||||||
try {
|
try {
|
||||||
await loginUser(email, password);
|
await loginUser(email, password);
|
||||||
// 登录成功后跳转到首页
|
// 登录成功后跳转到首页
|
||||||
router.push("/movies");
|
router.push("/home");
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error("Login failed:", error);
|
console.error("Login failed:", error);
|
||||||
|
|
||||||
|
|||||||
@ -291,7 +291,7 @@ const handleOAuthCallback = async () => {
|
|||||||
|
|
||||||
// 2秒后跳转到主页
|
// 2秒后跳转到主页
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const returnUrl = '/movies'
|
const returnUrl = '/home'
|
||||||
window.location.href = returnUrl
|
window.location.href = returnUrl
|
||||||
}, 2000)
|
}, 2000)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user