HttpAction.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. using LitJson;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using XRTool.Util;
  6. public class HttpAction : Singleton<HttpAction>
  7. {
  8. public string officeport
  9. {
  10. get
  11. {
  12. try
  13. {
  14. if (HttpSDKAction.Instance.jsonData != "")
  15. {
  16. string pt = "pro";
  17. #if UNITY_EDITOR
  18. pt = "dev";
  19. #endif
  20. JsonData data = JsonMapper.ToObject(HttpSDKAction.Instance.jsonData);
  21. if (data["unity"]["url"][pt] != null)
  22. {
  23. return data["unity"]["url"][pt]["officePort"].ToString();
  24. }
  25. else
  26. {
  27. return "1883";
  28. }
  29. }
  30. else
  31. {
  32. return "1883";
  33. }
  34. }
  35. catch
  36. {
  37. return "1883";
  38. }
  39. }
  40. }
  41. public string mqtturl
  42. {
  43. get
  44. {
  45. if (HttpSDKAction.Instance.officeSocket == "")
  46. {
  47. HttpSDKAction.Instance.officeSocket = "api-fat1.ghz-tech.com";
  48. }
  49. return HttpSDKAction.Instance.officeSocket;
  50. }
  51. }
  52. public string baseurl20
  53. {
  54. get
  55. {
  56. if (HttpSDKAction.Instance.loginUrl == "")
  57. {
  58. // HttpSDKAction.Instance.loginUrl = "https://api-fat2.ghz-tech.com/mr-navigator/v1";
  59. // HttpSDKAction.Instance.loginUrl = HttpSDKAction.Instance.managerUrl;
  60. }
  61. return HttpSDKAction.Instance.loginUrl;
  62. }
  63. }
  64. public string baseurl
  65. {
  66. get
  67. {
  68. if (HttpSDKAction.Instance.loginUrl == "")
  69. {
  70. // HttpSDKAction.Instance.loginUrl = "https://api-fat2.ghz-tech.com/mr-navigator/v1";
  71. // HttpSDKAction.Instance.loginUrl = HttpSDKAction.Instance.managerUrl;
  72. }
  73. return HttpSDKAction.Instance.loginUrl;
  74. }
  75. }
  76. //初始化场景
  77. public const string client_snInfo = "/client/snInfo";
  78. //public const string project_detail = "/project/detail";
  79. //初始化景点
  80. public const string sn_init = "/sn/init";
  81. //下载
  82. public const string file_download = "/file/download";
  83. //获取资源
  84. public const string material_init = "/material/init";
  85. //获取账号下场景id
  86. public const string project_init = "/project/index";
  87. //保存景点位
  88. public const string viewpoint_update = "/viewpoint/update";
  89. //电量
  90. public const string sn_electricity = "/sn/electricity";
  91. //识别的景点
  92. public const string sn_viewpoint = "/sn/viewpoint";
  93. // 偏移角
  94. public const string refrence = "/project/unityReference";
  95. public const string pointcloud = "/project/pointcloudInfo";
  96. public const string login = "/user/login";
  97. }