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
              })
            }
          }
        })

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐