vuex模块化

This commit is contained in:
aixianling
2022-06-10 16:46:03 +08:00
parent a85a2b5bfe
commit e409328271
4 changed files with 10 additions and 28 deletions

View File

@@ -46,19 +46,6 @@ const store = new Vuex.Store({
} else alert(res)
}).catch(err => alert(err))
},
setDicts(state, payload) {
if (payload) {
payload.map(p => {
if (state.dicts.some(d => d.key == p.key)) {
const index = state.dicts.findIndex(d => d.key == p.key)
state.dicts.splice(index, 1)
state.dicts.push(p)
} else {
state.dicts.push(p)
}
})
}
},
redirectCode(state, url = location.href) {
let REDIRECT_URI = encodeURIComponent(url),
corpid = state.config.corpid
@@ -286,14 +273,6 @@ const store = new Vuex.Store({
})
},
},
getters: {
getDict: state => key => {
if (key && state.dicts.length > 0) {
return state.dicts.find(e => e.key == key)
}
return null
}
},
modules: {user, waterMarker},
plugins: [perState({
storage: {