用vue-cli搭的脚手架,现在有api,但是他有个参数{"CatId":238,"Similar":false,"Trend":false,"IsNew":false,"Sales":true,"SuppNo":"LKN","SuppCatId":0}http://116.62.33.192:66/product/getproductdetaillist照网上axion那么写不知道参数要写在哪里,'/api': { target:'http://116.62.33.192:66/product/getproductdetaillist', changeOrigin:true, pathRewrite:{ '^/api': '/api' } } let postData = {'CatId': 238, 'Similar': false, 'Trend': false, 'IsNew': false, 'Sales': true, 'SuppNo': 'LKN', 'SuppCatId': 0}export default { methods: { jsonpData: function () { this.$axios.post('/api', postData) .then(res => { console.log(res) }) .catch(err => { console.log(err) }) } }}这么写他报404,不这么写,他报405.
添加回答
举报
0/150
提交
取消