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 {}
   }
}


