This commit is contained in:
u2nyakim 2025-08-28 09:40:16 +08:00
parent fa3bfda53b
commit 0e47ef526c
2 changed files with 4 additions and 3 deletions

View File

@ -62,6 +62,7 @@
import { useUserStore } from '@/store/modules/user'; import { useUserStore } from '@/store/modules/user';
import { logout } from '@/utils/common'; import { logout } from '@/utils/common';
import PasswordModal from './password-modal.vue'; import PasswordModal from './password-modal.vue';
import {userLogout} from "@/api/layout";
const { t } = useI18n(); const { t } = useI18n();
const { push } = useRouter(); const { push } = useRouter();
@ -86,7 +87,8 @@
t('layout.logout.title'), t('layout.logout.title'),
{ type: 'warning', draggable: true } { type: 'warning', draggable: true }
) )
.then(() => { .then(async () => {
await userLogout();
logout(false); logout(false);
}) })
.catch(() => {}); .catch(() => {});

View File

@ -10,12 +10,11 @@ import { userLogout } from '@/api/layout';
* @param from * @param from
* @param push * @param push
*/ */
export async function logout( export function logout(
route?: boolean, route?: boolean,
from?: string, from?: string,
push?: Router['push'] push?: Router['push']
) { ) {
await userLogout();
removeToken(); removeToken();
if (route && push) { if (route && push) {
push({ push({