Files
dvcp_v2_webapp/examples/store/index.js

29 lines
595 B
JavaScript
Raw Normal View History

2021-12-14 18:36:19 +08:00
import Vue from 'vue'
import Vuex from 'vuex'
import preState from 'vuex-persistedstate'
2022-07-19 15:20:10 +08:00
import * as modules from "dvcp-ui/lib/js/modules"
2022-08-18 15:36:24 +08:00
import axios from "../router/axios";
2021-12-14 18:36:19 +08:00
Vue.use(Vuex)
export default new Vuex.Store({
state: {
apps: []
},
mutations: {
addApp(state, app) {
state.apps.push(app)
},
cleanApps(state) {
state.apps = []
2022-08-18 15:36:24 +08:00
},
setFinanceUser(state) {
axios.post("appfinancialorganizationuser/checkUser").then(res => {
state.user.financeUser = res.data
}).catch(() => 0)
2022-07-27 14:26:26 +08:00
}
2021-12-14 18:36:19 +08:00
},
2022-07-19 15:20:10 +08:00
modules,
2021-12-14 18:36:19 +08:00
plugins: [preState()]
})