vue.config.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. const path = require('path');
  2. module.exports = {
  3. publicPath: process.env.NODE_ENV === 'development' ? '/' : process.env.VUE_APP_ROUTER,
  4. // outputDir: process.env.VUE_APP_ROUTER,
  5. configureWebpack: config => {
  6. Object.assign(config, {
  7. // 开发生产共同配置
  8. resolve: {
  9. alias: {
  10. '@': path.resolve(__dirname, './src'),
  11. '@c': path.resolve(__dirname, './src/components'),
  12. '@a': path.resolve(__dirname, './src/assets'),
  13. },
  14. },
  15. });
  16. },
  17. devServer: {
  18. port: '8001',
  19. //api地址前缀
  20. proxy: {
  21. '/weixin': {
  22. target: 'http://smart.cc-lotus.info',
  23. changeOrigin: true,
  24. ws: true,
  25. },
  26. '/files': {
  27. target: 'http://free.liaoningdoupo.com',
  28. },
  29. '/api/setting': {
  30. target: 'http://10.16.10.72:9000',
  31. // target: 'http://free.liaoningdoupo.com', //http://free.liaoningdoupo.com
  32. changeOrigin: true,
  33. ws: true,
  34. },
  35. '/api/affairs': {
  36. target: 'http://free.liaoningdoupo.com',
  37. changeOrigin: true,
  38. ws: true,
  39. },
  40. '/api/policy': {
  41. target: 'http://free.liaoningdoupo.com',
  42. changeOrigin: true,
  43. ws: true,
  44. },
  45. '/api/record': {
  46. target: 'http://free.liaoningdoupo.com',
  47. changeOrigin: true,
  48. ws: true,
  49. },
  50. '/api/serve': {
  51. target: 'http://free.liaoningdoupo.com',
  52. changeOrigin: true,
  53. ws: true,
  54. // pathRewrite: { '^/api/affairs': '/api' },
  55. },
  56. '/api/talent': {
  57. target: 'http://10.16.10.72:9008',
  58. changeOrigin: true,
  59. ws: true,
  60. // pathRewrite: { '^/api/affairs': '/api' },
  61. },
  62. '/api/market': {
  63. target: 'http://10.16.10.72:9004',
  64. changeOrigin: true,
  65. ws: true,
  66. // pathRewrite: { '^/api/affairs': '/api' },
  67. },
  68. '/api/live': {
  69. target: 'http://10.16.10.72:9009',
  70. changeOrigin: true,
  71. ws: true,
  72. // pathRewrite: { '^/api/affairs': '/api' },
  73. },
  74. '/ws': {
  75. target: 'http://free.liaoningdoupo.com',
  76. ws: true,
  77. },
  78. },
  79. },
  80. };