### **小程序的手機驗證碼登錄**
~~~
bindLoginMobilecode: function (e) {
var that=this
console.log(e.detail.value.code)
console.log(e.detail.value.mobile)
wx.request({
url:`${app.globalData.API_URL}/verify/checkVerify`,
data: {
mobile:e.detail.value.mobile,
verify:e.detail.value.code
},
method: 'post',
header: {
"content-type":"application/x-www-form-urlencoded"
}, // 設置請求的 header
success: function(res){
console.log(res)
if(res.data==1){
wx.navigateTo({
url: '../successInfo/successInfo',
})
}else{
wx.showToast({
title: '驗證碼錯誤,請重新發送驗證!',
icon: 'fail',
duration: 2000
})
}
that.setData({
codevalue:[]
})
},
fail: function() {
// fail
},
complete: function() {
// complete
}
})
},
~~~