config.js 1.1 KB

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