赞
踩
// 发送请求
sendRequest(){
wx.request({
url: 'http://localhost:8080/user/shop/status',
method: 'GET',
success: (res)=>{
// 这里的data不是后端中返回的data,而是固定的写法
// 代表的是后端整个的json数据
// 后端响应的数据是一个json数据,包含code,msg,data{}
console.log(res.data)
}
})
}
<view>
<button bind:tap="sendRequest" type="default">发送请求</button>
</view>
https://blog.csdn.net/weixin_42653522/article/details/106314957
https://blog.csdn.net/weixin_45060598/article/details/120686932
https://www.bilibili.com/video/BV1TP411v7v6/?p=75&spm_id_from=pageDriver&vd_source=0d2a9b4260ce977e642d073c6ee2260d
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。