1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #!/usr/bin/python3
- # -*- coding: utf-8 -*-
- from email import header
- import requests
- # cp=input("Press Enter to continue...")
- cp="dev-app"
- resp=0
- if cp=="login":
- url="https://www.51cow.cn:7715/api/login?uid=PC&pwd=mcs8%40666"
- resp=requests.get(url)
- if cp=="br-mcs":
- url = "http://8.130.17.8:7711/api/postData"
- param={
- "token": "7eea4610d4f1dcc572b7351f5a5fdef131571842484b03f05fa8e5a90486f227680272d2e47d7a98738b32473e0dffb348bd1b0273079c67d5ee3d90050d78c9",
- "request": "true",
- # "method": "startRecord",
- "method": "stopRecord",
- "data": {
- "devId": "apptest2",
- "peopleNo": 789,
- "workNo": 456,
- "storType": 0
- }
- }
- resp=requests.post(url,json=param)
- if cp=="fl-mcs":
- url ="https://www.51cow.cn:7715/api/GetRecordFileList"
- # sessionid="7eea4610d4f1dcc572b7351f5a5fdef131571842484b03f05fa8e5a90486f227680272d2e47d7a98738b32473e0dffb348bd1b0273079c67d5ee3d90050d78c9"
- param ={
- "sessionId": "7eea4610d4f1dcc572b7351f5a5fdef131571842484b03f05fa8e5a90486f227680272d2e47d7a98738b32473e0dffb348bd1b0273079c67d5ee3d90050d78c9",
- "st": "2022-07-24",
- "et": "2022-07-26",
- "did": "apptest2",
- "ft": "3",
- "lt": "-1",
- "wno": 4657,
- "pagesize": "10"
- }
- url="https://www.51cow.cn:7715/api/GetRecordFileList?sessionId=7eea4610d4f1dcc572b7351f5a5fdef131571842484b03f05fa8e5a90486f227680272d2e47d7a98738b32473e0dffb348bd1b0273079c67d5ee3d90050d78c9&st=2022-07-24&et=2022-07-26&did=apptest2&ft=3<=-1&key=&page=&pagesize=10&wno=4657"
- # url ="http://www.51cow.cn:7711/api/postData"
- # resp = requests.post(url+"?"+sessionid,json=param)
- # url ="https://tmrwatch.cn:8082/authdata"
- # url ="http://localhost:8082/authdata"
- # resp=requests.get(url,data=param,headers={"token":sessionid})
- # resp=requests.get(url,data=param)
- resp=requests.get(url)
- if cp=="dev-app":
- param={"name":"getBigupkeepListAPP","offset":1,"pagecount":10,
- "parammaps":{"loginId":3206,"loginpastureId":367,"statue":0}}
- url="https://tmrwatch.cn:8082/authdata/GetDataByName"
- token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IjAwNjExIiwicGFzc3dvcmQiOiJlMTBhZGMzOTQ5YmE1OWFiYmU1NmUwNTdmMjBmODgzZSIsImV4cCI6MTY1ODc3OTk3MSwiaXNzIjoiaHR0cHM6Ly9naXRodWIuY29tL2twdHl1bi9nby1hZG1pbi8ifQ.BsS2VeTpVaSzWOlGdAW4iYkT5O5XU0RYZn_NT0Otg94"
- requests.post(url,json=param,headers={"token":token})
- print(resp.text)
- print(resp.request.body)
- resp.close()
|