提交 444d95dd 编写于 作者: X xiaoyucoding

fix(mp-alipay): 修复存储假值时读取结果不正确的问题 fix #337

上级 8b362370
......@@ -12,12 +12,8 @@ export function getStorageSync (key) {
const result = my.getStorageSync({
key
})
// 不知道会不会出现 success 为 false 情况,暂时这样处理下。
if (result.success) {
return result.data || ''
} else {
return ''
}
// 支付宝平台会返回一个 success 值,但是目前测试的结果这个始终是 true。当没有存储数据的时候,其它平台会返回空字符串。
return result.data !== null ? result.data : ''
}
export function removeStorageSync (key) {
return my.removeStorageSync({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册