31 lines
591 B
JavaScript
31 lines
591 B
JavaScript
import Vue from 'vue'
|
|
import Vuex from 'vuex'
|
|
|
|
Vue.use(Vuex)
|
|
|
|
export default new Vuex.Store({
|
|
state: {
|
|
theme:'dark',
|
|
// 存储token
|
|
Authorization: localStorage.getItem('Authorization') ? localStorage.getItem('Authorization') : '',
|
|
},
|
|
getters: {
|
|
},
|
|
mutations: {
|
|
SET_THEME:(state,data)=>{
|
|
state.theme=data;
|
|
window.sessionStorage.setItem('theme',data);
|
|
},
|
|
changeLogin (state, user) {
|
|
state.Authorization = user.Authorization;
|
|
localStorage.setItem('Authorization', user.Authorization);
|
|
}
|
|
|
|
|
|
},
|
|
actions: {
|
|
},
|
|
modules: {
|
|
}
|
|
})
|