微信小程序前端js接口调用
wx.request({ url: 'test.php', //仅为示例,并非真实的接口地址 method: "POST", header: { //传输接收数据的头(!!!) 'content-type': 'application/x-www-form-urlencoded' }, data: { x:'x' }, success: function (res) { console.log(res.data) if (res.data==1){ that.data.isCode=true wx.showToast({ title: '验证码', icon: 'success', duration: 2000 }) }else{ wx.showToast({ title: '验证码错误', icon: 'success', duration: 2000 }) } } })
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

