You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
906 B

  1. /*
  2. copyright (c) 2018 jones
  3. http://www.apache.org/licenses/LICENSE-2.0
  4. 开源项目 https://github.com/jones2000/HQChart
  5. jones_2000@163.com
  6. 网络通讯
  7. */
  8. function JSNetwork()
  9. {
  10. }
  11. JSNetwork.IsDingTalk=false;
  12. JSNetwork.IsUniApp=false;
  13. JSNetwork.HttpRequest=function(obj)
  14. {
  15. if (JSNetwork.IsDingTalk)
  16. {
  17. JSNetwork.DD_httpRequest(obj);
  18. }
  19. else
  20. {
  21. JSNetwork.WX_Reqeust(obj);
  22. }
  23. }
  24. JSNetwork.WX_Reqeust=function(obj)
  25. {
  26. wx.request({
  27. url: obj.url,
  28. data:obj.data,
  29. method: obj.method,
  30. dataType: obj.dataType,
  31. success: obj.success,
  32. error:obj.error
  33. });
  34. }
  35. JSNetwork.DD_httpRequest=function(obj)
  36. {
  37. dd.httpRequest({
  38. url: obj.url,
  39. method: obj.method,
  40. data:obj.data,
  41. dataType: obj.dataType,
  42. success: obj.success
  43. });
  44. }
  45. export
  46. {
  47. JSNetwork
  48. };