import * as types from './mutation-types'
import {Cache} from '@/util/auth'

export const clearStore = function({commit, state}) {
  commit(types.SET_MENUMAP, Cache.clearMenuMap())
  commit(types.SET_USERINFO, Cache.clearUserInfo())
}

export const saveMenuMap= function({commit}, data) {
  commit(types.SET_MENUMAP, Cache.setMenuMap(data))
}

export const saveUserInfo = function({commit}, data) {
  commit(types.SET_USERINFO, Cache.setUserInfo(data))
}
