From feee0e9da651cdf36b519ed9d5c3eb4a5bc3b8dc Mon Sep 17 00:00:00 2001 From: qiang Date: Tue, 12 May 2020 21:03:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20App=20=E7=AB=AF=E4=BF=AE=E5=A4=8D=20v2?= =?UTF-8?q?=20=E5=8D=87=E7=BA=A7=20v3=20=E6=97=B6=20storage=20=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E7=9A=84=20Array=E3=80=81Date=20=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=AF=BB=E5=8F=96=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20question/96139?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/platforms/app-plus/service/api/storage/storage.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/platforms/app-plus/service/api/storage/storage.js b/src/platforms/app-plus/service/api/storage/storage.js index ad0d87cdb..b7e9b1590 100644 --- a/src/platforms/app-plus/service/api/storage/storage.js +++ b/src/platforms/app-plus/service/api/storage/storage.js @@ -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) {} -- GitLab