vue.config.js 758 B

12345678910111213141516171819202122
  1. const { defineConfig } = require('@vue/cli-service')
  2. module.exports = defineConfig({
  3. transpileDependencies: true,
  4. devServer:{
  5. proxy:{
  6. '/abc':{
  7. port:'8081',
  8. target: 'http://localhost:8080/foodssm_war_exploded/',//代理地址,这里设置的地址会代替axios中设置的baseURL
  9. changeOrigin: true,// 如果接口跨域,需要进行这个参数配置
  10. //ws: true, // proxy websockets
  11. //pathRewrite方法重写url
  12. pathRewrite: {
  13. '^/abc': '/'
  14. //pathRewrite: {'^/api': '/'} 重写之后url为 http://192.168.1.16:8085/xxxx
  15. //pathRewrite: {'^/api': '/api'} 重写之后url为 http://192.168.1.16:8085/api/xxxx
  16. },
  17. secure : false
  18. }
  19. }
  20. }
  21. })