mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-09 19:06:45 +08:00
---fix bug
This commit is contained in:
@@ -34,3 +34,4 @@ export const AUDIENCE_LIST = "/admin/thirdApi/audience/userAudiences";
|
||||
export const USER_PERMISSION = "/admin/thirdApi/permission/listByUser";
|
||||
export const VALIDATE_TOKEN = "/admin/thirdApi/validateToken";
|
||||
export const REFRESH_TOKEN = "/admin/thirdApi/refreshToken";
|
||||
export const LOGOUT = "/admin/thirdApi/logOut";
|
||||
|
||||
@@ -49,6 +49,8 @@ import {computed, reactive} from "vue";
|
||||
import {studentUrl,teacherUrl} from "@/api/method";
|
||||
import router from "@/router";
|
||||
import {useStore, createStore} from "vuex";
|
||||
import {LOGOUT} from "@/api/apis";
|
||||
import {request} from "@/api/request";
|
||||
|
||||
const store = useStore();
|
||||
|
||||
@@ -83,7 +85,8 @@ const changeRole = (value) => {
|
||||
}
|
||||
});
|
||||
};
|
||||
const logOut = () => {
|
||||
const logOut = async () => {
|
||||
await request(LOGOUT)
|
||||
store.replaceState(createStore({state: {openpages: []}}).state);
|
||||
localStorage.clear();
|
||||
(process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'alpine') ? router.push({path: '/login'}) : (window.location.href = window.location.protocol + process.env.VUE_APP_LOGIN_URL)
|
||||
|
||||
Reference in New Issue
Block a user