跨域请求携带cookie:
需要在代码中加上:withCredentials:true,
参考资料:https://www.jianshu.com/p/552daaf2869c
axios发送post请求,参数传递不过去:
https://www.jianshu.com/p/042632dec9fb
【官网建议】:
https://github.com/axios/axios/blob/master/README.md#using-applicationx-www-form-urlencoded-format
axios中文说明:
https://www.kancloud.cn/yunye/axios/234845
var params={
captcha:this.identiCode,
first_name:this.firstname,
last_name:this.lastname,
userName:this.username,
passwd:this.psd,
email:this.email,
user_type:userType,
}
var qs=require('qs');
axios.post('http://version2.hemasao.com/user/doRegister',qs.stringify(params)).then(function(res){
//res=qs.parse(res);
console.log(res);
});
//设置跨域携带cookie
//在main.js里面加入这句话即可(全局默认配置设置方法)
axios.defaults.withCredentials=true