chroe: adjust logout

This commit is contained in:
engigu
2025-08-11 11:58:38 +08:00
parent 20e073ff41
commit 7bd3ad8323
+3 -1
View File
@@ -1,5 +1,6 @@
// request.js
import axios from 'axios';
import { useRouter } from 'vue-router';
import { usePageState } from '../store/page_sate';
import { CONSTANT } from '../constant';
@@ -79,11 +80,12 @@ const handleException = (error) => {
// 登出系统
const logout = () => {
const router = useRouter();
const pageState = usePageState();
pageState.setIsLogin(false);
localStorage.removeItem(CONSTANT.STORE_TOKEN_NAME);
setTimeout(() => {
window.location.href = '/login';
router.push('/login');
}, 500);
};