mcs.py 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/usr/bin/python3
  2. # -*- coding: utf-8 -*-
  3. from email import header
  4. import requests
  5. # cp=input("Press Enter to continue...")
  6. cp="dev-app"
  7. resp=0
  8. if cp=="login":
  9. url="https://www.51cow.cn:7715/api/login?uid=PC&pwd=mcs8%40666"
  10. resp=requests.get(url)
  11. if cp=="br-mcs":
  12. url = "http://8.130.17.8:7711/api/postData"
  13. param={
  14. "token": "7eea4610d4f1dcc572b7351f5a5fdef131571842484b03f05fa8e5a90486f227680272d2e47d7a98738b32473e0dffb348bd1b0273079c67d5ee3d90050d78c9",
  15. "request": "true",
  16. # "method": "startRecord",
  17. "method": "stopRecord",
  18. "data": {
  19. "devId": "apptest2",
  20. "peopleNo": 789,
  21. "workNo": 456,
  22. "storType": 0
  23. }
  24. }
  25. resp=requests.post(url,json=param)
  26. if cp=="fl-mcs":
  27. url ="https://www.51cow.cn:7715/api/GetRecordFileList"
  28. # sessionid="7eea4610d4f1dcc572b7351f5a5fdef131571842484b03f05fa8e5a90486f227680272d2e47d7a98738b32473e0dffb348bd1b0273079c67d5ee3d90050d78c9"
  29. param ={
  30. "sessionId": "7eea4610d4f1dcc572b7351f5a5fdef131571842484b03f05fa8e5a90486f227680272d2e47d7a98738b32473e0dffb348bd1b0273079c67d5ee3d90050d78c9",
  31. "st": "2022-07-24",
  32. "et": "2022-07-26",
  33. "did": "apptest2",
  34. "ft": "3",
  35. "lt": "-1",
  36. "wno": 4657,
  37. "pagesize": "10"
  38. }
  39. url="https://www.51cow.cn:7715/api/GetRecordFileList?sessionId=7eea4610d4f1dcc572b7351f5a5fdef131571842484b03f05fa8e5a90486f227680272d2e47d7a98738b32473e0dffb348bd1b0273079c67d5ee3d90050d78c9&st=2022-07-24&et=2022-07-26&did=apptest2&ft=3&lt=-1&key=&page=&pagesize=10&wno=4657"
  40. # url ="http://www.51cow.cn:7711/api/postData"
  41. # resp = requests.post(url+"?"+sessionid,json=param)
  42. # url ="https://tmrwatch.cn:8082/authdata"
  43. # url ="http://localhost:8082/authdata"
  44. # resp=requests.get(url,data=param,headers={"token":sessionid})
  45. # resp=requests.get(url,data=param)
  46. resp=requests.get(url)
  47. if cp=="dev-app":
  48. param={"name":"getBigupkeepListAPP","offset":1,"pagecount":10,
  49. "parammaps":{"loginId":3206,"loginpastureId":367,"statue":0}}
  50. url="https://tmrwatch.cn:8082/authdata/GetDataByName"
  51. token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IjAwNjExIiwicGFzc3dvcmQiOiJlMTBhZGMzOTQ5YmE1OWFiYmU1NmUwNTdmMjBmODgzZSIsImV4cCI6MTY1ODc3OTk3MSwiaXNzIjoiaHR0cHM6Ly9naXRodWIuY29tL2twdHl1bi9nby1hZG1pbi8ifQ.BsS2VeTpVaSzWOlGdAW4iYkT5O5XU0RYZn_NT0Otg94"
  52. requests.post(url,json=param,headers={"token":token})
  53. print(resp.text)
  54. print(resp.request.body)
  55. resp.close()