去除null

This commit is contained in:
tangping 2023-06-06 09:52:13 +08:00
parent 00b5cfe7e5
commit 5be40135c3

View File

@ -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