dhb
dhb
  • 发布:2018-12-30 00:06
  • 更新:2018-12-30 00:29
  • 阅读:458

nvue 页面调用 uni.request 报错

分类:nvue
                uni.request({  
                    url:"http://192.168.3.9/news",  
                    dataType:"json",  
                    method:"post",  
                    data:{token:uni.getStorageSync("userToken"),type:this.tabBars[i].id},  
                    success:(res)=>{  
                        aryItem.data=res.data.data;  
                    }  
                });  
uni.postMessage({type:"完成"});  

报错

00:03:38.694 [ERROR] : TypeError: Attempted to assign to readonly property.filename:file:///var/mobile/Containers/Data/Application/CF440F54-F0BC-44ED-A528-2EF762887F93/Documents/Pandora/apps/0E09F7BFC9B048CB6BC486814CA279B9/www/__uniappservice.htmllineno:1
00:03:38.714 [LOG] : App.vue收到数据
00:03:38.734 [LOG] : {"type":"完成"}

2018-12-30 00:06 分享
已邀请:
dhb

dhb (作者)

查出来了,不是 request报错,是不支持 getStorageSync

要回复问题请先登录注册