|
@@ -3,15 +3,10 @@ const TOKEN_Key = "MZ_USER";
|
|
|
const PCTOKEN_Key = "MZ_TOKEN";
|
|
|
const COLOR_Key = "MZ_COLOR";
|
|
|
const store = createStore({
|
|
|
- state() {
|
|
|
- // user:window.localStorage.getItem(TOKEN_Key),
|
|
|
- // pctoken:window.localStorage.getItem(PCTOKEN_Key),
|
|
|
- // selectcolor:window.localStorage.getItem(COLOR_Key)
|
|
|
- return {
|
|
|
- user: window.localStorage.getItem(TOKEN_Key),
|
|
|
- pctoken: window.localStorage.getItem(PCTOKEN_Key),
|
|
|
- selectcolor: window.localStorage.getItem(COLOR_Key)
|
|
|
- }
|
|
|
+ state: {
|
|
|
+ user: window.localStorage.getItem(TOKEN_Key),
|
|
|
+ pctoken: window.localStorage.getItem(PCTOKEN_Key),
|
|
|
+ selectcolor: window.localStorage.getItem(COLOR_Key)
|
|
|
},
|
|
|
mutations: {
|
|
|
setUser(state, data) {
|
|
@@ -23,7 +18,7 @@ const store = createStore({
|
|
|
},
|
|
|
setPcToken(state, data) {
|
|
|
state.pctoken = data;
|
|
|
- xm.setStorage({ key: "MZ_TOKEN", value: state.pctoken }).then(() => {
|
|
|
+ xm.setStorage({ key: PCTOKEN_Key, value: state.pctoken }).then(() => {
|
|
|
})
|
|
|
window.localStorage.setItem(PCTOKEN_Key, state.pctoken);
|
|
|
},
|