【接口测试】axios测试接口

被刻印的时光 ゝ 提交于 2019-11-30 16:02:42

 

 

 

使用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
            }
        }
    },

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!