wx.request request:fail
发布于 5 年前 作者 elong 1726 次浏览 来自 问答

配置了很多次了,

提示

WAService.js:1 request:fail invalid url “https://test.kezhu.net/kzhotel/netwx/small

写过多个不同的接口,服务器tomcat

<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" keystoreFile="conf\www.domain.com.jks" keystorePass="changeit" SSLProtocol="TLSv1+TLSv1.1+TLSv1.2"  SSLCipherSuite="ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4" clientAuth="false" sslProtocol="TLS" />

返回值开始是json,后来干脆手写成{‘data’:‘aaaa’}或{data:‘aaaa’}

微信request安全地址: https://test.kezhu.net

https证书之前的赛门铁克换成目前是用的腾讯云的了,如有要求也可以换别的

以上做了n多天下来的结果,

附件图为chrome打开时的提示

最后是代码

 console.log(“ddddddddddddddd”)

    //得到用户信息

    wx.request({

      url:‘https://test.kezhu.net/kzhotel/netwx/small’, 

     // url:‘https://test.kezhu.net/ttt.htm’,

      header: {

      ‘content-type’: ‘application/json’

  },

   method: ‘GET’,

      success: function(res) {

        console.log(“dxsaDSAD”)

         console.log(res)

        console.log(res.data)

      }

      ,fail: function(res) {

        console.log(“fffff”)

         console.log(res)

        console.log(res.data)

      }

      })

  }

7 回复

怎么搞定的?

如何解决的?我的真机request直接返回一个null 没有任何反应,什么问题?

大师兄,请指点啊

做了尝试,换了windows版本,问题依旧,准备重构一个程序看看

怎么解决的?我Android会,iPhone手机不会。咋整

自己搞定了

WAService.js:1 request:fail invalid url "https://test.kezhu.net/kzhotel/netwx/small"B @ WAService.js:1request @ WAService.js:1(anonymous function) @ WAService.js:2onLoad @ index.js [sm]:35(anonymous function) @ WAService.js:3w @ WAService.js:3T @ WAService.js:3(anonymous function) @ WAService.js:3(anonymous function) @ WAService.js:3(anonymous function) @ WAService.js:1(anonymous function) @ WAService.js:1(anonymous function) @ WAService.js:2(anonymous function) @ asdebug.js:1n.emit @ asdebug.js:1r @ asdebug.js:1p @ asdebug.js:1(anonymous function) @ asdebug.js:1

index.js [sm]:48 fffff

index.js [sm]:49 Object {errMsg: “request:fail invalid url “https://test.kezhu.net/kzhotel/netwx/small””}errMsg: “request:fail invalid url “https://test.kezhu.net/kzhotel/netwx/small””__proto__: Object

index.js [sm]:50 undefined

回到顶部