错误:Failed to load http://zmn_mn_erp.com/index/activity.Activitymanage/sendCode: Req Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.
解决办法:
在请求时候,,设置了header的content-type属性
this.axios({
method: 'post',
url: '/index/activity.Activitymanage/sendCode',
headers:{
'Content-Type':'application/x-www-form-urlencoded'
},
data:{
phone:18201458175
}
}).then(fucntion(res){})
或
this.axios.post('/index/activity.Activitymanage/sendCode',getcode,{
headers:{
'Content-Type':'application/x-www-form-urlencoded'
}
}).then(fucntion(res){})
,但这样传值的时候,需要这样
var getcode = new URLSearchParams();
getcode.append('phone',me.params.leads_phone)