mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-19 08:32:14 +00:00
vue router implemented
This commit is contained in:
7
resources/js/store/modules/userAuth.js
vendored
7
resources/js/store/modules/userAuth.js
vendored
@@ -1,11 +1,13 @@
|
||||
import axios from 'axios'
|
||||
import {events} from '@/bus'
|
||||
import i18n from '@/i18n/index.js'
|
||||
import router from '@/router'
|
||||
|
||||
const defaultState = {
|
||||
authorized: undefined,
|
||||
app: undefined,
|
||||
}
|
||||
|
||||
const actions = {
|
||||
getAppData: ({commit, dispatch, getters}) => {
|
||||
|
||||
@@ -29,7 +31,8 @@ const actions = {
|
||||
|
||||
// Commit Remove Access Token from vuex storage
|
||||
commit('DESTROY_DATA')
|
||||
commit('SET_CURRENT_VIEW', 'files')
|
||||
|
||||
router.push({name: 'SignIn'})
|
||||
})
|
||||
},
|
||||
addToFavourites: (context, folder) => {
|
||||
@@ -85,6 +88,7 @@ const actions = {
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
RETRIEVE_APP_DATA(state, app) {
|
||||
state.app = app
|
||||
@@ -132,6 +136,7 @@ const mutations = {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const getters = {
|
||||
isLogged: state => state.authorized,
|
||||
isGuest: state => ! state.authorized,
|
||||
|
||||
Reference in New Issue
Block a user