用vue-cli搭建的vue项目,axios发起get请求的时候,控制台报错:Failed to load http://222.16.46.131:8080/Skyworth/changePictureAdmin: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 502.
我要访问的http://222.16.46.131:8080/Skyworth/changePictureAdmin是别人写好的,已经部署在其他服务器的接口,后台有设置cors,请问前端vue项目需要更改什么配置文件,才能成功跨域请求?
牛魔王的故事
相关分类