You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
587 B

10 months ago
  1. import Vue from 'vue';
  2. import Vuex from 'vuex';
  3. Vue.use(Vuex);
  4. const store = new Vuex.Store({
  5. state: {
  6. vuex_loginInfo: uni.getStorageSync('vuex_loginInfo') ? uni.getStorageSync('vuex_loginInfo') : {},
  7. },
  8. mutations: {
  9. update_vuex_loginInfo(state, payload) {
  10. state.vuex_loginInfo = payload
  11. uni.setStorageSync('vuex_loginInfo', payload);
  12. },
  13. goLogin(state) {
  14. uni.clearStorageSync()
  15. state.vuex_loginInfo = {}
  16. // state.vuex_userInfo = {}
  17. uni.navigateTo({
  18. url: '/pages/login/login'
  19. })
  20. },
  21. },
  22. actions: {
  23. },
  24. });
  25. export default store;