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

View File

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