let interval = null;

const state = {
  open: false,
  type: '',
  message: '',
  defaultMessage: '',
};

const mutations = {
  change (state, { open = false, type = '', message = '', defaultMessage = '😢发生错误咯' }) {
    console.log(message, defaultMessage);
    state.open = open;
    state.type = type;
    state.message = message || defaultMessage;
    state.defaultMessage = defaultMessage;
  },
};

const actions = {
  'alert-open' ({ commit }, { type, message, defaultMessage = '😢发生错误咯', ms = 3000 }) {
    commit('change', { open: true, type, message, defaultMessage });
    clearInterval(interval);
    interval = setInterval(() => {
      commit('change', { open: false });
      clearInterval(interval);
    }, ms);
  },
  'alert-close' ({ commit }) {
    commit('change', { open: false });
    clearInterval(interval);
  }
};

export default { state, mutations, actions };

@@ -212,50 +212,8 @@
 ) %7B%0A
-    console.log(message, defaultMessage);%0A
     

remove debug code