Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新手请教:上传图片一直显示跨域,设置标头无效 #215

Open
tytd opened this issue Oct 10, 2019 · 1 comment
Open

新手请教:上传图片一直显示跨域,设置标头无效 #215

tytd opened this issue Oct 10, 2019 · 1 comment

Comments

@tytd
Copy link

tytd commented Oct 10, 2019

const service = axios.create({ //process.env.NODE_ENV === 'development' ,//来判断是否开发环境 headers: { "Content-Type": "application/x-www-form-urlencoded", // "Access-Control-Allow-Origin": "http://localhost:8081", // "Access-Control-Allow-Methods": "GET, POST, PATCH, PUT, DELETE, OPTIONS", // "Access-Control-Allow-Headers": "Origin, Content-Type, X-Auth-Token" }, withCredentials: true ,//表示跨域请求时是否需要使用凭证 baseURL: 'http://localhost:59119',//'https://www.easy-mock.com/mock/592501a391470c0ac1fab128', timeout: 8000, })

@Bender65535
Copy link

老哥,这问题解决了吗,我也遇到这种情况了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants