|
|
@ -18,8 +18,14 @@ export function usingStorage() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const getValue = (key) => {
|
|
|
|
const getValue = (key) => {
|
|
|
|
const webStorage = getStorage()
|
|
|
|
if (window.localStorage) {
|
|
|
|
return webStorage.getItem(key)
|
|
|
|
return window.localStorage.getItem(key)
|
|
|
|
|
|
|
|
} else if (window.sessionStorage) {
|
|
|
|
|
|
|
|
return window.sessionStorage.getItem(key)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
console.error('browser not support localStorage and sessionStorage.')
|
|
|
|
|
|
|
|
return ''
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const setProperty = (key, value) => {
|
|
|
|
const setProperty = (key, value) => {
|
|
|
|