目录
- getStorage: localStorage获取值
- setStorage: localStorage设置值
- removeStorage: localStorage移除键为key的存储
- clearStorage: localStorage清空存储
- setCookie: 设置Cookie
- getCookie: 获取Cookie
- removeCookie: 清除Cookie
localStorage获取值
参数 | 类型 | 默认值 | 描述 |
---|---|---|---|
key | string | 存储的键 | |
[day] | number | 有效天数 |
localStorage设置值
参数 | 类型 | 默认值 | 描述 |
---|---|---|---|
key | string | 存储的键 | |
value | any | 存储的值 | |
[day] | number | 有效天数 |
localStorage移除键为key的存储
参数 | 类型 | 默认值 | 描述 |
---|---|---|---|
key | string | 存储的键 |
localStorage清空存储
设置Cookie
参数 | 类型 | 默认值 | 描述 |
---|---|---|---|
key | string | 存储的键 | |
value | any | 存储的值 | |
[expiredays] | number | 有效天数 | |
[domain] | string | 共享Cookie域名 |
获取Cookie
参数 | 类型 | 默认值 | 描述 |
---|---|---|---|
key | Any |
清除Cookie
参数 | 类型 | 默认值 | 描述 |
---|---|---|---|
key | string | 存储的键 | |
[domain] | string | 共享Cookie域名 |