chore: optimize the code of system layout; 🌟
This commit is contained in:
@@ -1,19 +1,13 @@
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
import account from './modules/account'
|
||||
import setting from './modules/setting'
|
||||
import modules from './modules'
|
||||
import PouchDB from 'pouchdb'
|
||||
|
||||
const db = new PouchDB('adminDb')
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
const store = new Vuex.Store({
|
||||
modules: {
|
||||
account,
|
||||
setting
|
||||
}
|
||||
})
|
||||
const store = new Vuex.Store({modules})
|
||||
// 读取用户信息
|
||||
db.get('currUser')
|
||||
.then(doc => store.commit('account/setUser', doc.user))
|
||||
|
||||
4
src/store/modules/index.js
Normal file
4
src/store/modules/index.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import account from './account'
|
||||
import setting from './setting'
|
||||
|
||||
export default {account, setting}
|
||||
Reference in New Issue
Block a user