zhangzengfei
2021-11-18 2f96ef3f59c0084d2943a7fdac9f47f51fe30da5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
 * @author chuzhixin 1204505056@qq.com (不想保留author可删除)
 * @description 异常捕获的状态拦截,请勿修改
 */
 
const state = () => ({
  errorLogs: [],
})
const getters = {
  errorLogs: (state) => state.errorLogs,
}
const mutations = {
  addErrorLog(state, errorLog) {
    state.errorLogs.push(errorLog)
  },
  clearErrorLog: (state) => {
    state.errorLogs.splice(0)
  },
}
const actions = {
  addErrorLog({ commit }, errorLog) {
    commit('addErrorLog', errorLog)
  },
  clearErrorLog({ commit }) {
    commit('clearErrorLog')
  },
}
export default { state, getters, mutations, actions }