物联网项目,先写好了 API,使用 JWT AUTH,token 写入 cookie,提示 Refused to set unsafe header "cookie"。
服务器已经设置了
header / Access-Control-Allow-Origin *
header / Access-Control-Allow-Credentials true
代码如下:
$.ajax({ url: "https://api.xxx.xxx/temperature/", type: "GET", beforeSend: function(xhr){ xhr.setRequestHeader('cookie', token) }, success: function(data){ alert(data); } }) 求解惑
