vue.config.js 1.6 KB

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