小程序请求数据


 wx.request({
      url: 'http://192.168.60.226/prosecount', //仅为示例,并非真实的接口地址
      header: {
        'content-type': 'application/json' // 默认值
      },
      data: {
        id: options.id
      },
      success: res => {
        if (res.statusCode === 200) {
          console.log(res.data)
          this.setData({
            array: res.data.user,
            comment: res.data.comment
          })  
        }
      }
    })  

 注意如果请求的数据的域名不是htts,请web微信开发者工具中关闭(不校验安全域名、web-view 域名、TLS 版本以及 HTTPS 证书)

位置在详情里面


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM