tanghaolin
2022-07-28 62aa8e0f0b366bc131309b72e1350d800d30be72
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**本地存储库 */
 
export default {
  /**
   * @description 设置
   */
  set(key, value) {
    localStorage.setItem(`${key}`, JSON.stringify(value))
  },
  /**
   * @description 获取
   */
  get(key) {
    return JSON.parse(localStorage.getItem(`${key}`))
  },
  /**
   * @description 删除令牌
   */
  remove(key) {
    localStorage.removeItem(`${key}`)
  },
  /**
   * @description 清除全部
   */
  clearAll() {
    localStorage.clear()
  },
}