vue.config.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. '/files': {
  26. target: 'http://free.liaoningdoupo.com',
  27. },
  28. '/api/setting': {
  29. target: 'http://10.16.10.72:9000',
  30. // target: 'http://free.liaoningdoupo.com', //http://free.liaoningdoupo.com
  31. changeOrigin: true,
  32. ws: true,
  33. },
  34. '/api/affairs': {
  35. target: 'http://free.liaoningdoupo.com',
  36. changeOrigin: true,
  37. ws: true,
  38. },
  39. '/api/policy': {
  40. target: 'http://free.liaoningdoupo.com',
  41. changeOrigin: true,
  42. ws: true,
  43. },
  44. '/api/record': {
  45. target: 'http://free.liaoningdoupo.com',
  46. changeOrigin: true,
  47. ws: true,
  48. },
  49. '/api/serve': {
  50. target: 'http://free.liaoningdoupo.com',
  51. changeOrigin: true,
  52. ws: true,
  53. // pathRewrite: { '^/api/affairs': '/api' },
  54. },
  55. '/api/talent': {
  56. target: 'http://free.liaoningdoupo.com',
  57. changeOrigin: true,
  58. ws: true,
  59. // pathRewrite: { '^/api/affairs': '/api' },
  60. },
  61. '/api/market': {
  62. target: 'http://10.16.10.72:9004',
  63. changeOrigin: true,
  64. ws: true,
  65. // pathRewrite: { '^/api/affairs': '/api' },
  66. },
  67. },
  68. },
  69. };