config.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //基本配置项
  2. const base = {
  3. debug: false
  4. }
  5. //http request请求配置
  6. const request = {
  7. // 服务器接口地址
  8. host: "http://192.168.2.70/dreamland/",
  9. //host: "http://192.168.3.66/dreamland/",
  10. // 请求的参数
  11. data: {},
  12. // 设置请求的 header,header 中不能设置 Referer。
  13. header: {},
  14. // (需大写)有效值:OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
  15. method: "POST",
  16. // json 如果设为json,会尝试对返回的数据做一次 JSON.parse
  17. dataType: "json",
  18. // text 设置响应的数据类型。合法值:text、arraybuffer 1.7.0
  19. responseType: "text",
  20. // 收到开发者服务成功返回的回调函数
  21. success() {},
  22. // 接口调用失败的回调函数
  23. fail() {},
  24. // 接口调用结束的回调函数(调用成功、失败都会执行)
  25. complete() {},
  26. }
  27. //上传配置
  28. const upload = {
  29. url: request.host + 'package/upload/?l=save.start',
  30. name: 'file',
  31. }
  32. //后端服务列表
  33. const server = {
  34. }
  35. export default {
  36. base,
  37. request,
  38. server,
  39. upload
  40. }