原有一个小程序,因业务需求再做一套h5的
在做h5的时候就遇到了跨域问题,我先是配置代理解决了本地跨域调试接口
但是打包部署到到线上去测试微信JSSDK的接口时被跨域拦截
之后找后端社区请求头,依然无效
先后查询资料说是传参问题,尝试了把参数转字符串啊,到后来直接写死参数
,但是直接就被浏览器拦截
接口的域名为https 而我打包部署的域名协议为http 域名也不一样
VUE项目,请求用的fly,
this.$http.post(api.getCollect, {
user_id: 150,
active_id:354
}).then((res) => {
console.log(res)
if (res.data.code === 200) {
this.$toast(res.data.msg);
this.isCollect = 1
} else {
this.$toast(res.data.msg);
}
}).catch(err => {
console.log(err.status, err.message)
})