userName: JSON.stringify(wx.getStorageSync('userInfo').userName),
得到的数据解析后带双引号,
这真是一个气吐血的坑。
需要在往storage种存储的时候使用
wx.setStorageSync('userInfo',JSON.parse(userInfo))
再解析
userName: wx.getStorageSync('userInfo').userName,
就能得到正常的数据了
userName: JSON.stringify(wx.getStorageSync('userInfo').userName),
得到的数据解析后带双引号,
这真是一个气吐血的坑。
需要在往storage种存储的时候使用
wx.setStorageSync('userInfo',JSON.parse(userInfo))
再解析
userName: wx.getStorageSync('userInfo').userName,
就能得到正常的数据了