vue.config.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. changeOrigin: true,
  34. ws: true,
  35. },
  36. '/api/setting': {
  37. target: 'http://10.16.10.72:9000',
  38. changeOrigin: true,
  39. ws: true,
  40. },
  41. '/api/affairs': {
  42. target: 'http://free.liaoningdoupo.com',
  43. changeOrigin: true,
  44. ws: true,
  45. },
  46. '/api/policy': {
  47. target: 'http://free.liaoningdoupo.com',
  48. changeOrigin: true,
  49. ws: true,
  50. },
  51. '/api/record': {
  52. target: 'http://free.liaoningdoupo.com',
  53. changeOrigin: true,
  54. ws: true,
  55. },
  56. '/api/serve': {
  57. target: 'http://free.liaoningdoupo.com',
  58. changeOrigin: true,
  59. ws: true,
  60. // pathRewrite: { '^/api/affairs': '/api' },
  61. },
  62. '/api/talent': {
  63. target: 'http://free.liaoningdoupo.com',
  64. changeOrigin: true,
  65. ws: true,
  66. // pathRewrite: { '^/api/affairs': '/api' },
  67. },
  68. // '/api/market': {
  69. // target: 'http://free.liaoningdoupo.com',
  70. // changeOrigin: true,
  71. // ws: true,
  72. // // pathRewrite: { '^/api/affairs': '/api' },
  73. // },
  74. // '/api/live': {
  75. // target: 'http://free.liaoningdoupo.com',
  76. // changeOrigin: true,
  77. // ws: true,
  78. // // pathRewrite: { '^/api/affairs': '/api' },
  79. // },
  80. },
  81. },
  82. };