wxml部分
< form class = "messages-info" bindsubmit = "sendData" > < input class = "messages-name" name = "name" /> < input class = "messages-msg" name = "msg" /> < button form-type = "submit" >提交</ button > < button form-type = "reset" >重置</ button > </ form > |
js部分
sendData(e){ wx.request({ url: 'https://www.xxxxxx.xxx:0000/xxxxx/xxx' , data: { name: e.detail.value.name, msg: e.detail.value.msg }, header: { 'content-type' : 'application/x-www-form-urlencoded' }, method: 'POST' }) } |
请求正常,但是console报错
我的合法域名信息有:https://www.xxxxxx.xxx:0000,并且get请求其他数据是正常的
报错信息去掉了我的https的s和端口号,并且提示http://www.xxxxxx.xxx不在request合法域名
你的域名有经过ICP备案么
有好的解决方案吗?
我也遇到这个问题了,有解决方案吗
请检查该域名是否已在后台配置完成
谢谢你的回复,如果你指的是配置request合法域名,我应该已经配置好了。
get请求是没有问题的,但是在表单需要的post请求时才报错,并且报错信息去掉了安全协议和端口号。
例如:我的url请求地址为https://www.xxxx.top:8080
报错为http://www.xxxx.top不在request合法域名列表。
微信不支持http请求,所以没法按照报错提示添加合法域名。
开发工具--详情--域名信息截图看看呢
自己做的接口,不想公开,打了阴影.....我是不会复制错的...
嗯,明白,这个在后台添加的时候不需要添加端口号的