去除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) {
|
||||
let storage = Taro.getStorageSync(key)
|
||||
if (!storage) {
|
||||
return {}
|
||||
return null
|
||||
}
|
||||
if (storage.expire > 0) {
|
||||
let time = (new Date()).getTime()
|
||||
time = Number(String(time).substr(0, 10))
|
||||
if (time > storage.expire) {
|
||||
DelData(key)
|
||||
return {}
|
||||
return null
|
||||
}
|
||||
}
|
||||
return storage._data
|
||||
|
Loading…
Reference in New Issue
Block a user