//这是我的配置
dev: {
env: require('./dev.env'),
port: 8080,
autoOpenBrowser: false,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
'/api': {
changeOrigin: true,
target: 'http://127.0.0.1:8087',
pathRewrite: {
'^/api': '/api'
}
}
},
// CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README
// (https://github.com/webpack/css-loader#sourcemaps)
// In our experience, they generally work as expected,
// just be aware of this issue when enabling this option.
cssSourceMap: false
}
调用
axios.post('/api/login', params).then(res => res.data)
但无法起到跨域的作用,求各位大神指点指点