tanghaolin
2025-03-06 2fdfc7907920e9003c62445b6000dc3c9edd6edb
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
29
/**本地存储库 */
 
export default {
    /**
     * @description 设置
     */
    set(key:string, value:any) {
      localStorage.setItem(`${key}`, JSON.stringify(value))
    },
    /**
     * @description 获取
     */
    get(key:string) {
      return JSON.parse(localStorage.getItem(`${key}`))
    },
    /**
     * @description 删除令牌
     */
    remove(key:string) {
      localStorage.removeItem(`${key}`)
    },
    /**
     * @description 清除全部
     */
    clearAll() {
      localStorage.clear()
    },
  }