import Cookie from "@/util/cookie";

const mutations={
  //设置token
  setToken(state,token){
    state.token=token;
    Cookie.set('cc_token',token);
  },
  //设置用户名
  setUserName(state,userName){
    state.userName=userName;
    Cookie.set('cc_user_name',userName);
  },
  mainCanShow(state){
    state.mainLoad = false
  },
  mainUnShow(state){
    state.mainLoad = true
  },
  changeParentRouter(state,data){
    state.menuList.find((a)=>{return a.name === data.name}).routerName = data.to.name
  }
};
export default mutations;
