我正在尝试从Reactjs应用程序中的授权API获取数据,但仍然出现401(未经授权)错误,并且'OPTIONS'请求也不断弹出,而不是GET请求。
const api_call = await axios.get(`api-link`, {'Access-Control-Allow-Headers': "Origin, X-Requested-With, Content-Type, Accept", 'Access-Control-Allow-Origin' : "*", headers: {'Authorization': "bearer API-auth"}});
const response= await api_call.json();
console.log(response);