Skip to content

Commit

Permalink
fix(mp-alipay): 修复存储假值时读取结果不正确的问题 fix dcloudio#337
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyucoding committed Apr 25, 2019
1 parent 8b36237 commit 444d95d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/platforms/mp-alipay/service/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 444d95d

Please sign in to comment.