Changeset View
Changeset View
Standalone View
Standalone View
src/resources/js/app.js
Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | methods: { | ||||
logoutUser(redirect) { | logoutUser(redirect) { | ||||
store.commit('logoutUser') | store.commit('logoutUser') | ||||
localStorage.setItem('token', '') | localStorage.setItem('token', '') | ||||
delete axios.defaults.headers.common.Authorization | delete axios.defaults.headers.common.Authorization | ||||
if (redirect !== false) { | if (redirect !== false) { | ||||
if (this.hasRoute('login')) { | if (this.hasRoute('login')) { | ||||
this.$router.push({ name: 'login' }) | this.$router.push({ name: 'login' }) | ||||
} else { | |||||
location.href = window.config['app.url'] + '/login' | |||||
} | } | ||||
} | } | ||||
clearTimeout(this.refreshTimeout) | clearTimeout(this.refreshTimeout) | ||||
}, | }, | ||||
// Display "loading" overlay inside of the specified element | // Display "loading" overlay inside of the specified element | ||||
addLoader(elem) { | addLoader(elem) { | ||||
$(elem).css({position: 'relative'}).append($(loader).addClass('small')) | $(elem).css({position: 'relative'}).append($(loader).addClass('small')) | ||||
▲ Show 20 Lines • Show All 313 Lines • Show Last 20 Lines |