webpack 发表于 2018-07-11 proxyvue-cliconfig/index.js 1234567891011121314module.exports = { dev: { // Paths assetsSubDirectory: "static", assetsPublicPath: "/", proxyTable: { "/api": { target: "http://86.100.18.170:7070", //dp pathRewrite: { "^/api": "" } } }, host: process.env.HOST, port: 8080, } 请求前需要加上 /api 123const service = axios.create({ baseURL: '/api/', // api的base_url}) 本文结束,感谢您的阅读 打赏 微信支付 支付宝