vue.config.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. const path = require('path');
  2. const frame = path.resolve(__dirname, '../frame');
  3. const center = path.resolve(__dirname, '../train-center');
  4. module.exports = {
  5. publicPath: process.env.NODE_ENV === 'development' ? '/' : process.env.VUE_APP_ROOT_URL + 'director',
  6. configureWebpack: {
  7. // externals: {
  8. // 'element-ui': 'Element',
  9. // vue: 'Vue',
  10. // },
  11. // 开发生产共同配置
  12. resolve: {
  13. alias: {
  14. '@': path.resolve(__dirname, './src'),
  15. '@c': path.resolve(__dirname, './src/components'),
  16. '@a': path.resolve(__dirname, './src/assets'),
  17. '@frame': frame,
  18. '@center': center,
  19. },
  20. },
  21. },
  22. devServer: {
  23. port: '8002',
  24. //api地址前缀
  25. proxy: {
  26. '/api': {
  27. target: 'http://free.liaoningdoupo.com',
  28. changeOrigin: true,
  29. ws: true,
  30. },
  31. '/files': {
  32. target: 'http://smart.cc-lotus.info',
  33. changeOrigin: true,
  34. ws: true,
  35. },
  36. '/ws': {
  37. target: 'http://smart.cc-lotus.info',
  38. ws: true,
  39. },
  40. '/weixin': {
  41. target: 'http://smart.cc-lotus.info',
  42. changeOrigin: true,
  43. ws: true,
  44. },
  45. '/admin/center': {
  46. target: 'http://localhost:8001',
  47. },
  48. '/admin/director': {
  49. target: 'http://localhost:8002',
  50. },
  51. '/admin/teacher': {
  52. target: 'http://localhost:8003',
  53. },
  54. '/admin/student': {
  55. target: 'http://localhost:8004',
  56. },
  57. '/admin/school': {
  58. target: 'http://localhost:8005',
  59. },
  60. },
  61. },
  62. };