【发布时间】:2019-11-28 17:01:51
【问题描述】:
我在 react 中使用 axios,他没有将 Origin 标头放在请求中,所以他给了服务器端 cors (nodejs) 问题。
import axios from 'axios';
const api = axios.create({baseURL: window.location.protocol + '//' + window.location.hostname + '/node/api/', withCredentials: true});
export default api;
【问题讨论】: