Skip to content

Commit

Permalink
fix(admin/pages/current/logout): 无论服务端是否退出成功前端页面都将跳转至登录页
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Oct 23, 2024
1 parent df550c8 commit c9cd3f2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions admin/src/pages/current/logout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//
// SPDX-License-Identifier: MIT

import { JSX } from 'solid-js';
import { useNavigate } from '@solidjs/router';
import { JSX, onMount } from 'solid-js';

import { useApp, useOptions } from '@/app/context';

Expand All @@ -12,8 +12,10 @@ export default function(): JSX.Element {
const nav = useNavigate();
const opt = useOptions();

ctx.logout().then(()=>{
onMount(async()=>{
await ctx.logout();
nav(opt.routes.public.home);
});
})

return <></>;
}
}

0 comments on commit c9cd3f2

Please sign in to comment.