1. 项目结构 2. vue.config.js 中添加 target为后台接口域名。 devServer: { proxy: { '/api': { target: 'http://b.qiuyeye.cn', changeOrigin: true, pathRewrite: { '/api': '' } } } } 3. api.js 中修改 原baseURL为http://b.qiuyeye.cn/index.php