
// 获取token
export function getToken () {
  return localStorage.getItem('access_token')
}

// 设置token
export function setToken (token) {
  return localStorage.setItem('access_token', token)
}

// 清除token
export function deleteToken () {
  return localStorage.removeItem('access_token')
}

// 获取动态路由
// export function getRoles () {
//   return JSON.parse(localStorage.getItem('roles')) ?? []
// }

// 设置动态路由
// export function setRoles (roles) {
//   return localStorage.setItem('roles', JSON.stringify(roles))
// }

// // 清除动态路由
// export function deleteRoles () {
//   return localStorage.removeItem('roles')
// }

// 获取动态路由
export function getPermission () {
  return JSON.parse(localStorage.getItem('permission')) ?? []
}

// 设置动态路由
export function setPermission (permission) {
  return localStorage.setItem('permission', JSON.stringify(permission))
}

// 清除动态路由
export function deletePermission () {
  return localStorage.removeItem('permission')
}
