getApiRes.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. import axios from 'axios';
  2. import global from '../Global.js'
  3. // 基础方法进行封装
  4. function getApiBasic(url, postdata) {
  5. return axios.post(url, postdata).then(function (data) {
  6. let json = data.data;
  7. return json
  8. }, function (response) {
  9. console.info(response);
  10. })
  11. }
  12. // 调用的api改写成方法
  13. export function worldDetail(postdata) {
  14. let url = headapi + 'worldDetail';
  15. return getApiBasic(url, postdata);
  16. }
  17. // 测试用接口
  18. export function editbasicinfo(postdata) {
  19. let url = headapi + 'editbasicinfo';
  20. return getApiBasic(url, postdata);
  21. }
  22. export function modPwd(postdata) {
  23. let url = headapi + 'modPwd';
  24. return getApiBasic(url, postdata);
  25. }
  26. export function getLoftInfo(postdata) {
  27. let url = headapi + 'getLoftInfo';
  28. return getApiBasic(url, postdata);
  29. }
  30. export function wifiSingle(postdata) {
  31. let url = headapi + 'wifiSingle';
  32. return getApiBasic(url, postdata);
  33. }
  34. export function Scan(postdata) {
  35. let url = headapi + 'Scan';
  36. return getApiBasic(url, postdata);
  37. }
  38. export function Watching(postdata) {
  39. // let url = headapi + 'Watching';
  40. // return getApiBasic(url,postdata);
  41. let item = [];
  42. let t = 0;
  43. for (var i = 0; i < 9; i++) {
  44. t = i + 1;
  45. item.push({
  46. 'time': "@date",
  47. 'checkRs': "Signal设备03@integer(301,600)检测完成,206会议室安全",
  48. })
  49. }
  50. let res = {
  51. Rs: item,
  52. Code: 0,
  53. Memo: '登陆成功'
  54. };
  55. return res;
  56. }
  57. // 真实接口
  58. // 用户登录
  59. export function SignIn(postdata) {
  60. let url = headapi + 'v1/Auth/SignIn';
  61. return getApiBasic(url, postdata);
  62. }
  63. // 获取验证图片
  64. export function GenVerifyPic(postdata) {
  65. let url = headapi + 'v1/Auth/GenVerifyPic';
  66. return getApiBasic(url, postdata);
  67. }
  68. // 用户退出
  69. export function SignOut(postdata) {
  70. let url = headapi + 'v1/Auth/SignOut';
  71. return getApiBasic(url, postdata);
  72. }
  73. // Region
  74. // 添加区域
  75. export function RegionAdd(postdata) {
  76. let url = headapi + 'v1/Region/Add';
  77. return getApiBasic(url, postdata);
  78. }
  79. // 区域详情
  80. export function RegionDetail(postdata) {
  81. let url = headapi + 'v1/Region/Detail';
  82. return getApiBasic(url, postdata);
  83. }
  84. // 区域列表
  85. export function RegionList(postdata) {
  86. let url = headapi + 'v1/Region/List';
  87. return getApiBasic(url, postdata);
  88. }
  89. // Detector
  90. // 添加检测设备
  91. export function DetectorAdd(postdata) {
  92. let url = headapi + 'v1/Detector/Add';
  93. return getApiBasic(url, postdata);
  94. }
  95. // 添加检测设备
  96. export function DetectorEdit(postdata) {
  97. let url = headapi + 'v1/Detector/Edit';
  98. return getApiBasic(url, postdata);
  99. }
  100. // 检测设备详情
  101. export function DetectorDetail(postdata) {
  102. let url = headapi + 'v1/Detector/Detail';
  103. return getApiBasic(url, postdata);
  104. }
  105. // 检测设备列表
  106. export function DetectorList(postdata) {
  107. let url = headapi + 'v1/Detector/List';
  108. return getApiBasic(url, postdata);
  109. }
  110. // 检测设备列表
  111. export function Region06G(postdata) {
  112. let url = headapi + 'v1/Index/Region06G';
  113. return getApiBasic(url, postdata);
  114. }
  115. // 区域wifi信道信息
  116. export function WifiChannel(postdata) {
  117. let url = headapi + 'v1/Index/WifiChannel';
  118. return getApiBasic(url, postdata);
  119. }
  120. // 区域监控平面
  121. export function MonitorArea(postdata) {
  122. let url = headapi + 'v1/Index/MonitorArea';
  123. return getApiBasic(url, postdata);
  124. }
  125. // 实时监控详情
  126. export function NetDevMonitor(postdata) {
  127. let url = headapi + 'v1/Index/NetDevMonitor';
  128. return getApiBasic(url, postdata);
  129. }
  130. // 探测设备工作监控
  131. export function WirelessMonitor(postdata) {
  132. let url = headapi + 'v1/Index/WirelessMonitor';
  133. return getApiBasic(url, postdata);
  134. }