【接口测试】axios测试接口

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



1、路在何方? 路在脚下 2、何去何从? 每个人都在探索,未来的方向在何处。如果说某些方向是世人已经公认的,那么就先按照公认的去走吧(ps:站在巨人的肩膀上看世界会清晰)。 如果说方向,当今世人还不清晰准确。那么就大胆往前走吧,对与错并不重要。心中的方向更加重要。
原文地址:https://www.cnblogs.com/yuanjili666/p/11603081.html