Skip to content

Commit

Permalink
fix(admin/app/context): 修正手动刷新时会跳转至登录页的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Oct 8, 2024
1 parent c68eba5 commit 9947f40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion admin/src/app/context/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function buildContext(opt: Required<buildOptions>, f: API) {
/**
* 是否已经登录
*/
isLogin() { return !!user(); },
isLogin() { return f.isLogin(); },

/**
* 清除浏览器的所有缓存
Expand Down
2 changes: 1 addition & 1 deletion admin/src/app/toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function Username(): JSX.Element {

const activator = <Button style={/*@once*/'flat'} onClick={()=>setVisible(!visible())}>{ctx.user()?.name}</Button>;

return <Show when={ctx.isLogin()}>
return <Show when={ctx.user()}>
<Menu hoverable={/*@once*/true} anchor={/*@once*/true} direction={/*@once*/'left'} selectedClass='' activator={activator}>{buildItems(ctx.locale(), opt.userMenus)}</Menu>
</Show>;
}
Expand Down

0 comments on commit 9947f40

Please sign in to comment.