diff --git a/fe/src/utils/axios.js b/fe/src/utils/axios.js index 88d5201..6759545 100644 --- a/fe/src/utils/axios.js +++ b/fe/src/utils/axios.js @@ -26,10 +26,8 @@ http.interceptors.request.use((config) => { //响应拦截器 http.interceptors.response.use(async (response) => { - const globalStatus = useGlobalStatusStore(); //响应成功 if (response.data.errorNo === 403) { - globalStatus.isLogin = false await router.replace({ path: '/login', diff --git a/fe/src/views/LoginView.vue b/fe/src/views/LoginView.vue index 6113c66..b366cda 100644 --- a/fe/src/views/LoginView.vue +++ b/fe/src/views/LoginView.vue @@ -28,8 +28,6 @@ import {useGlobalStatusStore} from "@/stores/useGlobalStatusStore"; const globalStatus = useGlobalStatusStore(); // eslint-disable-next-line no-unused-vars -let isLogin = globalStatus.isLogin -const userInfos = globalStatus.userInfos const form = reactive({ account: '', @@ -41,8 +39,7 @@ const onSubmit = () => { if (res.errorNo !== 0) { ElMessage.error(res.errorMsg) } else { - isLogin = true - userInfos.value = res.data + Object.assign(globalStatus.userInfos , res.data) router.replace({ path: '/', query: {