// 动态获取icon路径
export const getIconUrl = url => {
  const r = new URL('../assets/icons/' + url + '.png', import.meta.url)
  return r.href
}

// 获取本地存储
export const getLocalStorage = key => {
  if (typeof window !== 'undefined') {
    return window.localStorage.getItem(key)
  }
  return null
}

// 设置本地存储
export const setLocalStorage = (key, value) => {
  if (typeof window !== 'undefined') {
    window.localStorage.setItem(key, value)
  }
}
