vue.config.js 455 B

12345678910111213141516
  1. const { defineConfig } = require('@vue/cli-service')
  2. module.exports = defineConfig({
  3. transpileDependencies: true,
  4. devServer: {
  5. proxy: {
  6. '/api': {
  7. target: 'http://127.0.0.1:8088', // 代理到你的本地服务器
  8. changeOrigin: true, // 如果是跨域请求,设置为 true
  9. pathRewrite: {
  10. '^/api': '', // 将接口路径的 `/api` 去掉,直接代理到后端接口
  11. },
  12. },
  13. },
  14. },
  15. })