提交 feee0e9d 编写于 作者: Q qiang

fix: App 端修复 v2 升级 v3 时 storage 存储的 Array、Date 类型数据读取错误的问题 question/96139

上级 229346a4
......@@ -93,8 +93,12 @@ function parseGetStorage (type, value) {
data = object
if (typeof object === 'string') {
object = JSON.parse(object)
// eslint-disable-next-line valid-typeof
data = typeof object === (type === 'null' ? 'object' : type) ? object : data
const objectType = typeof object
if (objectType === 'number' && type === 'date') {
data = new Date(object)
} else if (objectType === (['null', 'array'].indexOf(type) < 0 ? type : 'object')) {
data = object
}
}
}
} catch (error) {}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册