byt-ui 0.0.12 → 0.0.13
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/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Description:
|
|
3
3
|
* @Author: 王国火
|
|
4
4
|
* @Date: 2022-10-08 09:10:49
|
|
5
|
-
* @LastEditTime: 2022-10-25
|
|
5
|
+
* @LastEditTime: 2022-10-25 11:03:35
|
|
6
6
|
* @LastEditors: 王国火
|
|
7
7
|
*/
|
|
8
8
|
import { validatenull } from './validate'
|
|
@@ -34,7 +34,7 @@ export const getStore = (key,debug = false) => {
|
|
|
34
34
|
const name = `${keyName}-${key}`
|
|
35
35
|
let obj = window.sessionStorage.getItem(name)||window.localStorage.getItem(name)
|
|
36
36
|
let content
|
|
37
|
-
if (validatenull(obj)) return
|
|
37
|
+
if (validatenull(obj)) return null
|
|
38
38
|
try {
|
|
39
39
|
obj = JSON.parse(obj)
|
|
40
40
|
} catch (e) {
|
|
@@ -57,13 +57,10 @@ export const getStore = (key,debug = false) => {
|
|
|
57
57
|
/**
|
|
58
58
|
* 删除localStorage
|
|
59
59
|
*/
|
|
60
|
-
export const removeStore = (key
|
|
60
|
+
export const removeStore = (key) => {
|
|
61
61
|
const name = `${keyName}-${key}`
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
} else {
|
|
65
|
-
window.localStorage.removeItem(name)
|
|
66
|
-
}
|
|
62
|
+
window.sessionStorage.removeItem(name)
|
|
63
|
+
window.localStorage.removeItem(name)
|
|
67
64
|
}
|
|
68
65
|
|
|
69
66
|
/**
|