tanghaolin
2022-08-31 244c4241427b9f3316f06f1e0ae2ee571edc1a23
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()
  },
}