修复修改密码弹窗&取消后台显示客服弹窗 & 取消退出登录profile为空抛异常的判断

This commit is contained in:
Eamon-meng
2026-02-27 15:03:17 +08:00
parent 2125f1ef9e
commit 4b18c91157
5 changed files with 45 additions and 37 deletions

View File

@@ -75,19 +75,19 @@ export function Content(props: {children: ReactNode}) {
}
function ContentResolved() {
const profile = use(useProfileStore(store => store.profile))
if (!profile) throw new Error('登录状态异常')
return (
<>
<RealnameAuthDialog
triggerClassName="hidden"
defaultOpen={!profile.id_token}
/>
<ChangePasswordDialog
triggerClassName="hidden"
defaultOpen={!profile.has_password}
/>
</>
)
if (profile)
return (
<>
<RealnameAuthDialog
triggerClassName="hidden"
defaultOpen={!profile.id_token}
/>
<ChangePasswordDialog
triggerClassName="hidden"
defaultOpen={!profile.has_password}
/>
</>
)
}
export function Header() {
@@ -127,8 +127,7 @@ export function Header() {
function HeaderUserCenter() {
const profile = use(useProfileStore(store => store.profile))
if (!profile) throw new Error('登录状态异常')
return <UserCenter profile={profile}/>
if (profile) return <UserCenter profile={profile}/>
}
export function Navbar() {