Skip to content

Commit

Permalink
fix(storage): 微信小程序无值时返回空字符串
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Nov 26, 2018
1 parent c955ba7 commit 2257472
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ const storage = {
}
return result(value)
} catch (err) {
return result(rawValue != null ? rawValue : defaultValue)
return result(
rawValue != null && /** 微信小程序无值时返回空字符串 */ rawValue !== ''
? rawValue
: defaultValue
)
}
},

Expand Down

0 comments on commit 2257472

Please sign in to comment.