2021-09-27 10:01:12 +08:00
|
|
|
import Vue from 'vue'
|
|
|
|
import Vuex from 'vuex'
|
2021-11-15 08:22:01 +08:00
|
|
|
import cloneDeep from 'lodash/cloneDeep'
|
|
|
|
import common from './modules/common'
|
|
|
|
import user from './modules/user'
|
2021-09-27 10:01:12 +08:00
|
|
|
|
|
|
|
Vue.use(Vuex)
|
|
|
|
|
2021-11-15 08:22:01 +08:00
|
|
|
export default new Vuex.Store({
|
|
|
|
modules: {
|
|
|
|
common,
|
|
|
|
user
|
|
|
|
},
|
|
|
|
mutations: {
|
|
|
|
// 重置vuex本地储存状态
|
|
|
|
resetStore (state) {
|
|
|
|
Object.keys(state).forEach((key) => {
|
|
|
|
state[key] = cloneDeep(window.SITE_CONFIG['storeState'][key])
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
strict: process.env.NODE_ENV !== 'production'
|
2021-09-27 10:01:12 +08:00
|
|
|
})
|