vue.config.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. const path = require('path');
  2. const frame = path.resolve(__dirname, '../frame');
  3. module.exports = {
  4. publicPath: process.env.NODE_ENV === 'development' ? '/' : '/teachersel',
  5. outputDir: 'teachersel',
  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. '@frame': frame,
  15. },
  16. },
  17. });
  18. },
  19. devServer: {
  20. port: '8006',
  21. //api地址前缀
  22. proxy: {
  23. '/files': {
  24. target: 'http://free.liaoningdoupo.com',
  25. changeOrigin: true,
  26. ws: true,
  27. },
  28. '/weixin': {
  29. target: 'http://smart.cc-lotus.info',
  30. changeOrigin: true,
  31. ws: true,
  32. },
  33. '/ws': {
  34. target: 'http://free.liaoningdoupo.com',
  35. ws: true,
  36. },
  37. '/admin/center': {
  38. target: 'http://free.liaoningdoupo.com',
  39. },
  40. // '/api/train/department': {
  41. // target: 'http://free.liaoningdoupo.com',
  42. // },
  43. '/admin/director': {
  44. target: 'http://free.liaoningdoupo.com',
  45. },
  46. '/admin/teacher': {
  47. target: 'http://free.liaoningdoupo.com',
  48. },
  49. '/admin/student': {
  50. target: 'http://free.liaoningdoupo.com',
  51. },
  52. '/admin/school': {
  53. target: 'http://free.liaoningdoupo.com',
  54. },
  55. '/api/code': {
  56. target: 'http://smart.cc-lotus.info',
  57. ws: true,
  58. },
  59. '/api': {
  60. target: 'http://free.liaoningdoupo.com',
  61. changeOrigin: true,
  62. ws: true,
  63. },
  64. },
  65. },
  66. };