webpack-dev-server配置
webpack.config.js中修改
devServer: { historyApiFallback: true, noInfo: true, inline: true, stats: { colors: true }, proxy: { '/api': { target: 'http://192.168.1.130:8080/', pathRewrite: {'^/api' : ''}, changeOrigin: true, secure: false, } } },
js调用:
.Ajax("/login",{ }, function(data){ consol.log(data) })