存这个鬼是这样存的:plus.storage.setItem("user",JSON.stringify(msg));
获取这个东西
var newuser = plus.storage.getItem("user");
console.log(newuser)
var test=[{user:{userid:"1"}}]
console.log(test)
console.log(newuser[0].user.userid)
userid1 = tmp[0].user.userid
console.log(userid1)
这样取不出来userid ,但是我写的test测试都行
报错信息:
"[{
"user" :{
"nickname" :"cvfrr",
"tel" :"",
"userid" :"0261VXDZF58EBY8",
"createdate" :"2015-09-21 15:24:11",
"usertype" :"general",
"password" :"123456",
"isvalid" :1,
"companyid" :"88",
"username" :"aaaaa1",
"email" :"",
"description" :"然而各顾各",
"note" :"rrr"
}
}]" at webview-subpage-serve-info.html:95
[object Object] at webview-subpage-serve-info.html:97
Uncaught TypeError: Cannot read property 'userid' of undefined at webview-subpage-serve-info.html:98
4 个回复
画眉 (作者)
需要把获取的格式也转成object么? 怎么弄呢?
画眉 (作者)
这是什么原因造成的呢,怎么解决呢
画眉 (作者)
Dcloud呢 快出来帮我看看
DCloud_UNI_FXY