From 2409e0ea0e6b8cba1206abaffebd7f618432ae06 Mon Sep 17 00:00:00 2001 From: Bytetrex Date: Fri, 9 Apr 2021 15:55:42 +0800 Subject: [PATCH] fix --- src/App.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/App.vue b/src/App.vue index 6020bf4..b225f00 100644 --- a/src/App.vue +++ b/src/App.vue @@ -20,23 +20,23 @@ export default { Footer, }, mounted() { - const jwt = localStorage.getItem("token"); - const wind = localStorage.getItem("wind404"); + const jwt = JSON.parse(localStorage.getItem("token")); + const wind = JSON.parse(localStorage.getItem("wind404")); if (jwt) { this.$store.commit("setToken", jwt); } + Object.assign(axios.defaults, { + headers: { Authorization: this.$store.state.user.token }, + }); + if (wind) { this.$store.commit("setWind", wind); } else { this.$store.commit("setWind", wind); } - Object.assign(axios.defaults, { - headers: { Authorization: this.$store.state.user.token }, - }); - if (this.$store.state.debug) { this.$buefy.snackbar.open({ message: this.$t("errors.devBuild"),