Class StorageManager

本地存储

Hierarchy

  • StorageManager

Constructors

Properties

_id: string = ...
_iv: null | string = null
_key: null | string = null

Accessors

  • get encrypted(): boolean
  • 数据加密开关

    Returns boolean

Methods

  • 清空整个本地存储

    Returns void

  • 获取指定关键字的数据

    Returns

    Parameters

    • key: string

      获取的关键字

    • defaultValue: any = ""

      获取的默认值

    Returns string

  • 获取指定关键字的布尔值

    Parameters

    • key: string

    Returns boolean

  • 获取指定关键字的JSON对象

    Parameters

    • key: string
    • Optional defaultValue: any

    Returns any

  • 获取数据分组关键字

    Parameters

    • key: string

    Returns string

  • 获取指定关键字的数值

    Parameters

    • key: string
    • defaultValue: number = 0

    Returns number

  • 初始化密钥

    Parameters

    • key: string

      aes加密的key

    • iv: string

      aes加密的iv

    Returns void

  • 删除指定关键字的数据

    Returns

    Parameters

    • key: string

      需要移除的关键字

    Returns void

  • 存储本地数据

    Returns

    Parameters

    • key: string

      存储key

    • value: any

      存储值

    Returns void

  • 设置用户唯一标识

    Parameters

    • id: string

    Returns void

Generated using TypeDoc