前后端全面升级

This commit is contained in:
pycook
2023-07-10 17:42:15 +08:00
parent c444fed436
commit db5ff60aff
629 changed files with 97789 additions and 23995 deletions

View File

@@ -1,29 +1,61 @@
/* eslint-disable */
import Vue from 'vue'
import Vuex from 'vuex'
import app from './modules/app'
import user from './modules/user'
import i18n from './modules/i18n'
import permission from './modules/permission'
import getters from './getters'
import app from './global/app'
import user from './global/user'
import routes from './global/routes'
import logo from './global/logo'
import notice from './global/notice'
import getters from './global/getters'
import appConfig from '@/config/app'
console.log(appConfig)
Vue.use(Vuex)
export default new Vuex.Store({
const store = new Vuex.Store({
modules: {
app,
user,
permission,
i18n
routes,
logo,
notice
},
state: {
windowWidth: 800,
windowHeight: 600,
currentTime: 0,
},
mutations: {
SET_WINDOW_SIZE(state, { width, height }) {
state.windowWidth = width
state.windowHeight = height
},
SET_TIME: (state, time) => {
state.currentTime = time
},
},
actions: {
setWindowSize({ commit }) {
const width = window.innerWidth
const height = window.innerHeight
commit('SET_WINDOW_SIZE', { width, height })
},
setTime: ({ commit }, time) => {
commit('SET_TIME', time)
}
},
getters
})
appConfig.buildModules.forEach(appName => {
if (appName !== 'fullscreen') {
import(`@/modules/${appName}/index.js`).then(m => {
if (m.default.store) {
store.registerModule(m.default.store.name || m.deault.name, m.default.store)
}
})
}
})
export default store