vuex模块化
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user