index.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. Vue.use(Vuex);
  4. import LoginStore from './modules/login';
  5. import ConversationStore from './modules/conversation';
  6. import MessageStore from './modules/message';
  7. import ContactsStore from './modules/contacts';
  8. import GroupStore from './modules/group';
  9. import InformStore from './modules/inform';
  10. import ReceiveInviteStore from './modules/receiveInvite';
  11. const store = new Vuex.Store({
  12. modules: {
  13. LoginStore,
  14. ConversationStore,
  15. MessageStore,
  16. ContactsStore,
  17. GroupStore,
  18. InformStore,
  19. ReceiveInviteStore,
  20. },
  21. state: {
  22. merchantsDataAll: {}, //查询反显用户的数据
  23. merchantsStatus: 0, //商户数据状态 0新增 1修改
  24. vuexstatus: []//用户状态
  25. },
  26. getters: {
  27. merchantsDataAlls(state) {
  28. return state;
  29. }
  30. },
  31. mutations: {
  32. changeMerchants(state, n) {
  33. state.merchantsDataAll = n;
  34. },
  35. changeMerchantsStatus(state, n) {
  36. state.merchantsStatus = n;
  37. },
  38. isvuexstatus(state, n) {
  39. state.vuexstatus = n;
  40. },
  41. RESET_STORE: (state) => {
  42. console.log('>>>>>重置store', store);
  43. store.commit('RESET_MESSAGE_STORE');
  44. store.commit('RESET_LOGIN_STORE');
  45. store.commit('RESET_CONTACTS_STORE');
  46. store.commit('RESET_GROUP_STORE');
  47. store.commit('RESET_INFORM_STORE');
  48. store.commit('RESET_RECEIVE_INVITE_STIRE');
  49. store.commit('RESET_CONVERSATION_STORE');
  50. },
  51. },
  52. actions: {}
  53. })
  54. export default store