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