index.js 479 B

12345678910111213141516171819202122232425
  1. import Vue from 'vue';
  2. import Vuex from 'vuex';
  3. import cache from '../library/cache'
  4. import helper from '../library/helper'
  5. import chat from './chat'
  6. Vue.use(Vuex)
  7. export default new Vuex.Store({
  8. modules: {
  9. chat
  10. },
  11. state: {
  12. userinfo: {
  13. id: '00000',
  14. nickname: '请先登录',
  15. signature: '',
  16. name:''
  17. }
  18. },
  19. mutations: {
  20. update_userinfo(state, userinfo) {
  21. state.userinfo = userinfo;
  22. uni.setStorageSync('userinfo', userinfo);
  23. }
  24. }
  25. });