Axios having CORS issue

后端 未结 6 1942
温柔的废话
温柔的废话 2020-11-30 05:38

I added proxy in package.json and it worked great, but after npm run build the CORS issue has resurfaced again, does anyone know how to deal with CORS issue after npm run bu

6条回答
  •  庸人自扰
    2020-11-30 06:01

    I have encountered with same issue. When I changed content type it has solved. I'm not sure this solution will help you but maybe it is. If you don't mind about content-type, it worked for me.

    axios.defaults.headers.post['Content-Type'] ='application/x-www-form-urlencoded';
    

提交回复
热议问题