success news hot

This commit is contained in:
2023-12-23 18:01:51 +08:00
parent 46905ed6f1
commit 2faf2db922
17 changed files with 584 additions and 260 deletions

View File

@@ -6,14 +6,29 @@ Vue.use(Vuex)
export default new Vuex.Store({
state: {
theme:'dark',
// 存储token
Authorization: localStorage.getItem('Authorization') ? localStorage.getItem('Authorization') : '',
isLogin:'0',
},
getters: {
getStorage(state){ // 获取本地存储的登录信息
if(!state.Authorization){
state.Authorization =JSON.parse(localStorage.getItem(key))
}
return state.Authorization
}
},
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: {
},