diff --git a/vue.config.js b/vue.config.js index ec12735..2a8ce56 100644 --- a/vue.config.js +++ b/vue.config.js @@ -35,9 +35,16 @@ module.exports = { overlay: { warnings: false, errors: true - } + }, // before: require('./mock/mock-server.js') + // 代理配置 + proxy: { + '/api': { // 这里的api 表示如果我们的请求地址有/api的时候,就出触发代理机制 + target: 'http://ihrm-java.itheima.net', // 我们要代理的地址 + changeOrigin: true + } + } }, configureWebpack: { // provide the app's title in webpack's name field, so that