|
@@ -16,7 +16,7 @@ export const setStore = (params) => {
|
|
datetime: new Date().getTime()
|
|
datetime: new Date().getTime()
|
|
}
|
|
}
|
|
if (type) window.sessionStorage.setItem(name, JSON.stringify(obj))
|
|
if (type) window.sessionStorage.setItem(name, JSON.stringify(obj))
|
|
- else window.localStorage.setItem(name, JSON.stringify(obj))
|
|
|
|
|
|
+ else window.sessionStorage.setItem(name, JSON.stringify(obj))
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -30,11 +30,11 @@ export const getStore = (params) => {
|
|
} = params
|
|
} = params
|
|
let obj = {}
|
|
let obj = {}
|
|
let content = null
|
|
let content = null
|
|
- obj = window.localStorage.getItem(name)
|
|
|
|
|
|
+ obj = window.sessionStorage.getItem(name)
|
|
if (validatenull(obj)) obj = window.sessionStorage.getItem(name)
|
|
if (validatenull(obj)) obj = window.sessionStorage.getItem(name)
|
|
if (validatenull(obj)) return
|
|
if (validatenull(obj)) return
|
|
if (type) obj = window.sessionStorage.getItem(name)
|
|
if (type) obj = window.sessionStorage.getItem(name)
|
|
- else obj = window.localStorage.getItem(name)
|
|
|
|
|
|
+ else obj = window.sessionStorage.getItem(name)
|
|
obj = JSON.parse(obj)
|
|
obj = JSON.parse(obj)
|
|
if (debug) {
|
|
if (debug) {
|
|
return obj
|
|
return obj
|
|
@@ -61,7 +61,7 @@ export const removeStore = params => {
|
|
let {
|
|
let {
|
|
name
|
|
name
|
|
} = params
|
|
} = params
|
|
- window.localStorage.removeItem(name)
|
|
|
|
|
|
+ window.sessionStorage.removeItem(name)
|
|
window.sessionStorage.removeItem(name)
|
|
window.sessionStorage.removeItem(name)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -84,9 +84,9 @@ export const getAllStore = (params) => {
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
list.push(getStore({
|
|
list.push(getStore({
|
|
- name: window.localStorage.key(i),
|
|
|
|
|
|
+ name: window.sessionStorage.key(i),
|
|
content: getStore({
|
|
content: getStore({
|
|
- name: window.localStorage.key(i)
|
|
|
|
|
|
+ name: window.sessionStorage.key(i)
|
|
})
|
|
})
|
|
}))
|
|
}))
|
|
}
|
|
}
|
|
@@ -105,5 +105,5 @@ export const clearStore = (params) => {
|
|
window.sessionStorage.clear()
|
|
window.sessionStorage.clear()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- window.localStorage.clear()
|
|
|
|
|
|
+ window.sessionStorage.clear()
|
|
}
|
|
}
|