@ftlab/one-vue3 0.2.10 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -1
- package/package.json +1 -1
- package/utils/{storage.ts → storage.js} +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
9
9
|
|
|
10
|
-
## [v0.2.
|
|
10
|
+
## [v0.2.11](https://gitlab.ftlapp.cn/ftl/ftlab/one-vue3/compare/v0.2.2...v0.2.11)
|
|
11
11
|
|
|
12
12
|
### Commits
|
|
13
13
|
|
|
@@ -16,6 +16,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
16
16
|
- feat: support iconfont [`5268467`](https://gitlab.ftlapp.cn/ftl/ftlab/one-vue3/commit/526846752ca3de05e7e78a665a7b1c1ff1b40b9f)
|
|
17
17
|
- feat: menu style detail change [`93c3abb`](https://gitlab.ftlapp.cn/ftl/ftlab/one-vue3/commit/93c3abba52a689bf6e0e265e4ad2c4aad38605fd)
|
|
18
18
|
- fix: fix collapse style error [`54e9525`](https://gitlab.ftlapp.cn/ftl/ftlab/one-vue3/commit/54e9525a99b216a9f7bb1b29ec578a768b49cb93)
|
|
19
|
+
- charge storage to js [`1d1368d`](https://gitlab.ftlapp.cn/ftl/ftlab/one-vue3/commit/1d1368ddb5d1ce8ecbc5754530b46f705146013f)
|
|
19
20
|
- fix: remove type declare [`d611d3a`](https://gitlab.ftlapp.cn/ftl/ftlab/one-vue3/commit/d611d3ab302a4426e96f1c1e4e7ae940e427c9a9)
|
|
20
21
|
- chore: charge ts to js [`e2feead`](https://gitlab.ftlapp.cn/ftl/ftlab/one-vue3/commit/e2feeadc54c45ddab43a8947d38cb1decc76d230)
|
|
21
22
|
- fix: winter time tz bug [`3f984ee`](https://gitlab.ftlapp.cn/ftl/ftlab/one-vue3/commit/3f984eebce6e6409084439fd0342bbaf883693c1)
|
package/package.json
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
get(key
|
|
2
|
+
get(key) {
|
|
3
3
|
return localStorage.getItem(key);
|
|
4
4
|
},
|
|
5
|
-
set(key
|
|
5
|
+
set(key, value) {
|
|
6
6
|
localStorage.setItem(key, value);
|
|
7
7
|
},
|
|
8
|
-
remove(key
|
|
8
|
+
remove(key) {
|
|
9
9
|
localStorage.removeItem(key);
|
|
10
10
|
},
|
|
11
11
|
// 保存token到本地缓存
|
|
12
|
-
setToken(token
|
|
13
|
-
this.set(
|
|
12
|
+
setToken(token) {
|
|
13
|
+
this.set('token', token);
|
|
14
14
|
},
|
|
15
15
|
// 保存用户信息到本地缓存
|
|
16
|
-
setAuth(auth
|
|
17
|
-
this.set(
|
|
16
|
+
setAuth(auth) {
|
|
17
|
+
this.set('auth', JSON.stringify(auth));
|
|
18
18
|
},
|
|
19
19
|
// 读取token
|
|
20
20
|
getToken() {
|
|
21
|
-
return this.get(
|
|
21
|
+
return this.get('token');
|
|
22
22
|
},
|
|
23
23
|
// 读取用户信息
|
|
24
24
|
getAuth() {
|
|
25
|
-
return this.get(
|
|
25
|
+
return this.get('auth') ? JSON.parse(this.get('auth')) : {};
|
|
26
26
|
},
|
|
27
27
|
};
|