标签:dcl ssl OLE 方法 本地ip 真机调试 toolbar request 问答
onLoad: function(e) { uni.request({ url: ‘http://localhost:8088/api/Gift‘, method: ‘GET‘, data: {}, success: (res) => { this.GiftInfo = res.data; }, fail: (fa) => { console.log(fa); } }) }
DCloud社区相关问答:https://ask.dcloud.net.cn/question/80062
uni.request官方文档:https://uniapp.dcloud.io/api/request/request
onLoad: function(e) { uni.request({ url: ‘https://ip:端口号/api/Gift‘, method: ‘GET‘, data: {}, sslVerify: false, success: (res) => { this.GiftInfo = res.data; }, fail: (fa) => { console.log(fa); } }) }
上述代码访问本地接口数据成功!
End!
uni-app真机调试报错request:fail abort解决方法
标签:dcl ssl OLE 方法 本地ip 真机调试 toolbar request 问答
原文地址:https://www.cnblogs.com/gygg/p/12106435.html