vue.config.js 2.4 KB

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