配置了很多次了,
提示
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)
}
})
}
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