A helper wrapped on the top of wechat-minapp sdk to make it more developer-friendly.
MIT License
对微信小程序 API 的封装,对开发更友好。
wx.getStorage({ key: '' })
=> wx.getStorage('key')
Error
对象替换掉微信小程序的错误对象。官方原始调用方式:
wx.getStorage({
key: 'local_token',
success: (res) => {
console.log(res.data)
},
fail: (err) => {
console.error(err.errMsg)
},
})
现在:
wx.getStorage('local_token')
.then((res) => {
console.log(res)
})
.catch((err) => {
console.error(err.message)
})