使用axios测试接口(这个是get请求的数据)

axios({
  method:"GET",
  url:"/api/category/product/model-detail-by-model-id-new?entityId=4&modelId=11222&proModelId=13&source=3"
}).then((data)=>{
  console.log(data,6);
})
},


//////////////////////////////////
vue的配置文件中,需要设置跨域请求地址

 devServer:{
        open:true,
        port:9000,
        //服务器代理跨域
        proxy:{
            "/ajax":{
                target:"http://m.maoyan.com",
                changeOrigin:true
            },
            "/locate":{
                target:"http://apimobile.meituan.com",
                changeOrigin:true
            },
            "/api":{
                target:"https://cmsjapi.dataoke.com",
                changeOrigin:true
            }
        }
    },



 

相关文章:

  • 2021-11-13
  • 2022-03-06
  • 2021-12-21
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-20
猜你喜欢
  • 2022-01-18
  • 2022-01-01
  • 2021-11-06
  • 2021-06-16
  • 2022-01-14
  • 2021-06-04
  • 2021-12-18
相关资源
相似解决方案