diff --git a/apps/blogai/app/[locale]/auth/sign-in/mix-signin.tsx b/apps/blogai/app/[locale]/auth/sign-in/mix-signin.tsx index bab318d..aea2631 100644 --- a/apps/blogai/app/[locale]/auth/sign-in/mix-signin.tsx +++ b/apps/blogai/app/[locale]/auth/sign-in/mix-signin.tsx @@ -68,16 +68,8 @@ export function MixSignIn(props: { } localStorage.setItem("UserData", JSON.stringify(result.data)); - // []方法 - { {/* localStorage["name"]="bonly"; */ } } console.log("--result.data:", result.data) - - setTimeout(() => { - window.location.href = `/`; - }, 10000); // 延迟 10 秒跳转 - - //window.location.href = `/` - + window.location.href = `/` }).catch((err) => { setIsLoading(false); console.log(err); diff --git a/apps/blogai/components/header.tsx b/apps/blogai/components/header.tsx index bb6802c..e9202e0 100644 --- a/apps/blogai/components/header.tsx +++ b/apps/blogai/components/header.tsx @@ -69,15 +69,8 @@ export function Header() {
- {/* */} - {(!!userData && !!userData.user_name) ? (
- {/* */}
diff --git a/apps/blogai/components/user-menu.tsx b/apps/blogai/components/user-menu.tsx index 7a465cc..9f1d730 100644 --- a/apps/blogai/components/user-menu.tsx +++ b/apps/blogai/components/user-menu.tsx @@ -65,13 +65,25 @@ export function UserMenu({ user }: { user: UserData }) {
{user?.user_name}
{user?.user_name}
*/} + + {/* 新增 "Profile" 选项 */} + { + router.push('/profile'); // 假设用户的个人资料页面是 "/profile" + }} + className="text-xs" + > + Profile + + + {/* 分隔线(可选) */} +
+ + {/* "Log Out" 选项 */} { - console.log('logout') - if (isLoading) return - setIsLoading(true); await service.post('/api/v1/customer/logout', { }, { @@ -90,30 +102,14 @@ export function UserMenu({ user }: { user: UserData }) { localStorage.removeItem("UserData"); - // router.refresh() - // router.push('/') - window.location.href = `/` - // location.reload(); }).catch((err) => { setIsLoading(false); localStorage.removeItem("UserData"); - // location.reload(); window.location.href = `/` console.log(err); - // if (err.errors[0].code === "form_identifier_not_found") { - // props.setAccountNotFound(true); - // props.email(email); - // } else { - // props.setError("Sorry, We couldn't sign you in. Please try again later"); - // } }); - - - // signOut({ - // callbackUrl: '/' - // }) } }