From 2ba58426cc5bbaddfab574efefe3efb6451ba28c Mon Sep 17 00:00:00 2001 From: duqingquan Date: Mon, 9 Oct 2023 19:38:58 +0800 Subject: [PATCH] =?UTF-8?q?storage=20=E7=A4=BA=E4=BE=8B=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=20=E7=B1=BB=E5=9E=8B=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/storage/storage.uvue | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/pages/API/storage/storage.uvue b/pages/API/storage/storage.uvue index 65d7a5d4..862ec4f9 100644 --- a/pages/API/storage/storage.uvue +++ b/pages/API/storage/storage.uvue @@ -197,10 +197,18 @@ export default { uni.getStorage({ key: key, success: (res) => { - that.apiGetData = res.data + that.apiGetData = res.data + + let desc:string = typeof this.apiGetData + if("object" == desc){ + desc = desc + ": " + JSON.stringify(this.apiGetData) + }else{ + desc = desc + ": " + this.apiGetData + } + uni.showModal({ title: '读取数据成功', - content: "data: '" + JSON.stringify(that.apiGetData) + "'", + content: desc, showCancel: false, }) }, @@ -223,10 +231,18 @@ export default { showCancel: false, }) } else { - this.apiGetData = uni.getStorageSync(key) + this.apiGetData = uni.getStorageSync(key) + + let desc:string = typeof this.apiGetData + if("object" == desc){ + desc = desc + ": " + JSON.stringify(this.apiGetData) + }else{ + desc = desc + ": " + this.apiGetData + } + uni.showModal({ title: '读取数据成功', - content: "data: '" + JSON.stringify(apiGetData) + "'", + content: desc, showCancel: false, }) } -- GitLab