vue.config.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. const { defineConfig } = require("@vue/cli-service");
  2. module.exports = defineConfig({
  3. transpileDependencies: true,
  4. lintOnSave: false,
  5. devServer: {
  6. proxy: {
  7. '/bench': {
  8. target: 'http://139.196.158.57:8080', //需要代理的域名,目标域名
  9. changeOrigin: true, //需要代理跨域
  10. rewrite: (path) => path.replace(/^\/bench/, ''), //路径重写,把'/api'替换为''
  11. },
  12. '/plan': {
  13. target: 'http://139.196.158.57:8080', //需要代理的域名,目标域名
  14. changeOrigin: true, //需要代理跨域
  15. rewrite: (path) => path.replace(/^\/plan/, ''), //路径重写,把'/api'替换为''
  16. },
  17. '/mantis-test': {
  18. target: 'http://139.196.158.57:8080', //需要代理的域名,目标域名
  19. changeOrigin: true, //需要代理跨域
  20. rewrite: (path) => path.replace(/^\/mantis-test/, ''), //路径重写,把'/api'替换为''
  21. },
  22. '/bmt-test': {
  23. target: 'http://139.196.158.57:8080', //需要代理的域名,目标域名
  24. changeOrigin: true, //需要代理跨域
  25. rewrite: (path) => path.replace(/^\/bmt-test/, ''), //路径重写,把'/api'替换为''
  26. },
  27. '/tts-test': {
  28. target: 'http://139.196.158.57:8080', //需要代理的域名,目标域名
  29. changeOrigin: true, //需要代理跨域
  30. rewrite: (path) => path.replace(/^\/tts-test/, ''), //路径重写,把'/api'替换为''
  31. },
  32. },
  33. },
  34. });