Skip to content

Commit

Permalink
Fix redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
LucHeart committed Sep 24, 2024
1 parent b4c77ca commit b31a26f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/store/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createStore } from 'vuex';
import axios from "axios";
import router from '@/router';

const store = createStore({
state() {
Expand Down Expand Up @@ -93,6 +94,8 @@ const store = createStore({
});
console.log("Successfully fetched self");
return;
} else if(res.status === 401) {
router.push('/account/login');
} else console.log("Self status code is " + res.status + " with message " + res.data);
} catch (e) {
console.log(e);
Expand Down

0 comments on commit b31a26f

Please sign in to comment.