提交 2ba58426 编写于 作者: 杜庆泉's avatar 杜庆泉

storage 示例增加 类型信息

上级 22d6befc
...@@ -198,9 +198,17 @@ export default { ...@@ -198,9 +198,17 @@ export default {
key: key, key: key,
success: (res) => { 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({ uni.showModal({
title: '读取数据成功', title: '读取数据成功',
content: "data: '" + JSON.stringify(that.apiGetData) + "'", content: desc,
showCancel: false, showCancel: false,
}) })
}, },
...@@ -224,9 +232,17 @@ export default { ...@@ -224,9 +232,17 @@ export default {
}) })
} else { } 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({ uni.showModal({
title: '读取数据成功', title: '读取数据成功',
content: "data: '" + JSON.stringify(apiGetData) + "'", content: desc,
showCancel: false, showCancel: false,
}) })
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册