vue.config.js 1.9 KB

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