This commit is contained in:
2023-12-28 16:18:19 +08:00
parent 76907fb95c
commit 7d9186d31c
15 changed files with 487 additions and 144 deletions

View File

@@ -5,7 +5,7 @@ Vue.use(Vuex)
export default new Vuex.Store({
state: {
theme:'dark',
theme:localStorage.getItem('theme') ? localStorage.getItem('theme') : '',
userId:localStorage.getItem('userId') ? localStorage.getItem('userId') : '',
userRole:localStorage.getItem('userRole') ? localStorage.getItem('userRole') : '',
// 存储token
@@ -14,9 +14,9 @@ export default new Vuex.Store({
getters: {
},
mutations: {
SET_THEME:(state,data)=>{
state.theme=data;
window.sessionStorage.setItem('theme',data);
setTheme:(state,data)=>{
state.theme=data.theme;
localStorage.setItem('theme',data.theme);
},
changeLogin (state, user) {
state.Authorization = user.Authorization;