client-auth.js 249 B

12345678910
  1. const key = 'auth'
  2. export const getAuthInfo = () => {
  3. const auth = window.localStorage.getItem(key)
  4. return auth ? JSON.parse(auth) : undefined
  5. }
  6. export const setAuthInfo = (auth) => {
  7. window.localStorage.setItem(key, JSON.stringify(auth))
  8. }