export const setUserInfo = (user:Object)=>{
    if(localStorage.getItem('userInfo')){
        localStorage.removeItem('userInfo')
        localStorage.setItem('userInfo',JSON.stringify(user))
     }else{
        localStorage.setItem('userInfo',JSON.stringify(user))
     }
}

export const getUserInfo = ()=>{
    if(localStorage.getItem('userInfo')){
      return localStorage.getItem('userInfo')
     }else{
       return {}
     }
}


export const setUid = (user:Object)=>{
  if(localStorage.getItem('uid')){
      localStorage.removeItem('uid')
      localStorage.setItem('uid',JSON.stringify(user))
   }else{
      localStorage.setItem('uid',JSON.stringify(user))
   }
}

export const getUid = ()=>{
  if(localStorage.getItem('uid')){
    return localStorage.getItem('uid')
   }else{
     return {}
   }
}


export const setRouter = (user:Object)=>{
  if(localStorage.getItem('router')){
      localStorage.removeItem('router')
      localStorage.setItem('router',JSON.stringify(user))
   }else{
      localStorage.setItem('router',JSON.stringify(user))
   }
}

export const getRouter = ()=>{
  if(localStorage.getItem('router')){
    return localStorage.getItem('router')
   }else{
     return {}
   }
}


