去除null
This commit is contained in:
parent
00b5cfe7e5
commit
5be40135c3
@ -45,14 +45,14 @@ export function SetAsyncData(key, data, t = 0) {
|
|||||||
export function GetData(key) {
|
export function GetData(key) {
|
||||||
let storage = Taro.getStorageSync(key)
|
let storage = Taro.getStorageSync(key)
|
||||||
if (!storage) {
|
if (!storage) {
|
||||||
return {}
|
return null
|
||||||
}
|
}
|
||||||
if (storage.expire > 0) {
|
if (storage.expire > 0) {
|
||||||
let time = (new Date()).getTime()
|
let time = (new Date()).getTime()
|
||||||
time = Number(String(time).substr(0, 10))
|
time = Number(String(time).substr(0, 10))
|
||||||
if (time > storage.expire) {
|
if (time > storage.expire) {
|
||||||
DelData(key)
|
DelData(key)
|
||||||
return {}
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return storage._data
|
return storage._data
|
||||||
|
Loading…
Reference in New Issue
Block a user