收费管理系统

index.js 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. const path = require('path')
  2. module.exports ={
  3. // transpileDependencies: true,
  4. // lintOnSave:false,
  5. // devServer:{
  6. // proxy:{
  7. // "/api":{
  8. // target:"http://xx.com/admin",//代理到的服务器地址
  9. // ws:false,//是否对websocket启动代理
  10. // changeOrigin:true,//用于控制请求头中的值
  11. // changeOrigin: true,//设置true 代表跨域访问
  12. // secure: false, // 如果是https接口,需要配置这个参数
  13. // pathRewrite:{
  14. // '^/api': '/'
  15. // }
  16. // }
  17. // }
  18. // }
  19. dev: {
  20. // Paths
  21. assetsSubDirectory: 'static',
  22. assetsPublicPath: '/',
  23. proxyTable: {
  24. '/api': {
  25. target: 'http://sf.sgjyun.com',//设置你调用的接口域名和端口号 别忘了加http 正式
  26. // target: 'http://hf.szjkhd.com',//设置你调用的接口域名和端口号 别忘了加http 测试
  27. changeOrigin: true,//设置true 代表跨域访问
  28. secure: false, // 如果是https接口,需要配置这个参数
  29. pathRewrite: {
  30. '^/api': '/'//这里理解成用‘/api’代替target里面的地址,后面组件中我们掉接口时直接用api代替 比如我要调用'http://40.00.100.100:3002/user/add',直接写‘/api/user/add’即可
  31. }
  32. }
  33. }
  34. }
  35. }