vue.config.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // const targetUrl = 'https://apizng.eavic.com';
  2. // const targetUrl = 'http://39.97.239.116:8080';
  3. // const targetUrl = 'http://192.168.1.200:8080';
  4. const targetUrl = 'http://10.64.81.2:8080';
  5. module.exports = {
  6. publicPath:'./',
  7. productionSourceMap: false,
  8. pages: {
  9. index: {
  10. // page 的入口
  11. entry: 'src/main.js',
  12. // 模板来源
  13. template: 'public/index.html',
  14. // 在 dist/index.html 的输出
  15. filename: 'index.html',
  16. // 当使用 title 选项时,template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title>
  17. title: '航空工业集团快递智能柜管理程序'
  18. },
  19. },
  20. devServer: {
  21. open: true,
  22. // host: 'localhost',
  23. port: 8080,
  24. https: false,
  25. //以上的ip和端口是我们本机的;下面为需要跨域的
  26. proxy: {//配置跨域
  27. '/api': {
  28. target: targetUrl,//这里后台的地址模拟的;应该填写你们真实的后台接口
  29. ws: true,
  30. changOrigin: true,//允许跨域
  31. pathRewrite: {
  32. '^/api': ''//请求的时候使用这个api就可以
  33. }
  34. }
  35. }
  36. },
  37. }