callme :function(){
var headers = {}
headers.Authorization = 'Bearer ' + localStorage.getItem('token')
this.$http.jsonp('http://abc.edf.cn/api/home',{headers:headers})
.then(function (response) {
//登录
}, function (response) {
//错误
});
}
报错401,这样写有问题吗?
在postman通过的
A JSONP request works by creating a <script> element with its src attribute set to the request URL.
You cannot add custom headers to the HTTP request sent by a <script> element.