vue.config.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // let targetUrl = 'http://47.99.212.176:8000'
  2. // let targetUrl = 'http://192.168.3.48:8000'
  3. let targetUrl = 'http://testadm.dayaedu.com/'
  4. module.exports = {
  5. // 调整内部的 webpack 配置。
  6. // 查阅 https://github.com/vuejs/vue-doc-zh-cn/vue-cli/webpack.md
  7. chainWebpack: () => {},
  8. configureWebpack: () => {},
  9. // 配置 webpack-dev-server 行为。
  10. devServer: {
  11. open: process.platform === 'darwin',
  12. host: '0.0.0.0',
  13. port: 9999,
  14. https: false,
  15. hotOnly: false,
  16. // 查阅 https://github.com/vuejs/vue-doc-zh-cn/vue-cli/cli-service.md#配置代理
  17. proxy: {
  18. '/contracts': {
  19. target: targetUrl,
  20. changeOrigin: true,
  21. ws: true,
  22. '^/contracts': '/contracts',
  23. xfwd: true
  24. },
  25. '/api-student': {
  26. target: targetUrl,
  27. changeOrigin: true,
  28. ws: true,
  29. '^/api-student': '/api-student',
  30. xfwd: true
  31. },
  32. '/api-cms': {
  33. target: targetUrl,
  34. changeOrigin: true,
  35. ws: true,
  36. '^/api-cms': '/api-cms',
  37. xfwd: true
  38. },
  39. '/api-teacher': {
  40. target: targetUrl,
  41. changeOrigin: true,
  42. ws: true,
  43. '^/api-teacher': '/api-teacher',
  44. xfwd: true
  45. },
  46. '/api-web': {
  47. target: targetUrl,
  48. changeOrigin: true,
  49. ws: true,
  50. '^/api-web': '/api-web',
  51. xfwd: true
  52. }
  53. }, // string | Object
  54. },
  55. css: {
  56. loaderOptions: {
  57. less: {
  58. modifyVars: {
  59. // red: '#03a9f4',
  60. blue: '#14928A',
  61. // orange: '#f08d49',
  62. // 'text-color': '#111'
  63. }
  64. }
  65. }
  66. },
  67. }