Skip to content

Commit

Permalink
用户状态同步修复 (#209)
Browse files Browse the repository at this point in the history

Co-authored-by: jinnrry <jinnrry@users.noreply.github.com>
  • Loading branch information
Jinnrry and Jinnrry authored Sep 26, 2024
1 parent b192680 commit 473206f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 0 additions & 2 deletions fe/src/utils/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 1 addition & 4 deletions fe/src/views/LoginView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: '',
Expand All @@ -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: {
Expand Down

0 comments on commit 473206f

Please sign in to comment.