123456789101112131415161718192021222324252627282930313233343536373839404142 |
- import Vue from 'vue'
- import Vuex from 'vuex'
- import { mutations } from './mutations'
- import { actions } from './actions'
- import { initBaseState } from './state'
- import chat from './module/chat/index'
- import group from './module/group/index'
- Vue.use(Vuex)
- const state = initBaseState()
- const getters = {
-
- isPrivate: state => {
- return /-/g.test(state.curSession)
- },
-
- otherUserId: state => {
- if (!state.curSession) return
- if (state.curSession.indexOf('-') > -1) {
- return state.curSession.replace('-', '').replace(state.userId, '')
- } else {
- return ''
- }
- },
- muteList: state => {
- return state.chat.sessionList.filter(item => item.is_mute == 1)
- }
- }
- export default new Vuex.Store({
- state,
- mutations,
- actions,
- getters,
- modules: {
- chat,
- group
- }
- })
|