up.
This commit is contained in:
parent
fa3bfda53b
commit
0e47ef526c
@ -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(() => {});
|
||||
|
||||
@ -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({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user