// 获取token
export const getToken = () => {
  return localStorage.getItem('ACCESS_TOKEN')
}

// 设置token
export const setToken = (token) => {
  return localStorage.setItem('ACCESS_TOKEN', token)
}

// 清除token
export const removeToken = () => {
  localStorage.removeItem('ACCESS_TOKEN')
  localStorage.removeItem('REFRESH_TOKEN')
}
// 获取刷新token
export const getRefreshToken = () => {
  return localStorage.getItem('REFRESH_TOKEN')
}

// 设置刷新token
export const setRefreshToken = (refreshToken) => {
  return localStorage.setItem('REFRESH_TOKEN', refreshToken)
}

// 租户ID
export const getTenantId = () => {
  return localStorage.getItem('tenantId')
}

export const setTenantId = (username) => {
  localStorage.setItem('tenantId', username)
}

// 招聘-企业token
export const getEnterpriseToken = () => {
  return localStorage.getItem('loginType') === 'enterprise' && localStorage.getItem('ACCESS_TOKEN')
}

// 招聘-个人token
export const getPersonalToken = () => {
  return localStorage.getItem('loginType') === 'personal' && localStorage.getItem('ACCESS_TOKEN')
}
