Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/App.vue
<template> | <template> | ||||
<router-view v-if="!isLoading && !routerReloading"></router-view> | <router-view v-if="!isLoading && !routerReloading" :key="$route.path"></router-view> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
export default { | export default { | ||||
data() { | data() { | ||||
return { | return { | ||||
isLoading: true, | isLoading: true, | ||||
routerReloading: false | routerReloading: false | ||||
} | } | ||||
}, | }, | ||||
mounted() { | mounted() { | ||||
const token = localStorage.getItem('token') | const token = localStorage.getItem('token') | ||||
this.$root.updateBodyClass() | |||||
if (token) { | if (token) { | ||||
this.$root.startLoading() | this.$root.startLoading() | ||||
axios.defaults.headers.common.Authorization = 'Bearer ' + token | axios.defaults.headers.common.Authorization = 'Bearer ' + token | ||||
axios.get('/api/auth/info?refresh_token=1') | axios.get('/api/auth/info?refresh_token=1') | ||||
.then(response => { | .then(response => { | ||||
this.$root.loginUser(response.data, false) | this.$root.loginUser(response.data, false) | ||||
this.$root.stopLoading() | this.$root.stopLoading() | ||||
Show All 26 Lines |