123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- import requests
- url = 'http://127.0.0.1:9000/v1/token'
- data = {
- 'username': 'admin',
- 'password': '123456',
- }
- response = requests.post(url=url, json=data)
- code = response.json().get('code')
- token = response.headers.get('authorization')
- url = 'http://58.34.94.177:29101/v6/api'
- data = {
- 'code': 1001,
- 'username': 'aabbcc',
- 'password': 'aabbcc',
- 'role_type': 1,
- 'name': 'aabbcc',
- 'cid': '112233',
- 'phone': '112233',
- 'sex': 0,
- 'department': 'aabbcc',
- 'wid': 'aabbcc',
- }
- response = requests.post(url=url, json=data, headers={'authorization': token})
- print(response.json())
- url = 'http://127.0.0.1:9000/v6/api'
- data = {
- 'code': 1002,
- 'page': 1,
- 'size': 3,
- 'name': 'a',
- 'phone': '',
- 'role_type': ['2'],
- }
- response = requests.post(url=url, json=data, headers={'authorization': token})
- print(response.json())
- """
- {
- 'code': 0,
- 'data': [
- {
- 'uuid': '65dbeb1c49fbe311a3a01d34',
- 'name': 'aabbcc',
- 'cid': '112233',
- 'phone': '112233',
- 'sex': 0, # 性别 (0:未设置 1:男 2:女)
- 'department': 'aabbcc',
- 'wid': 'aabbcc',
- 'state': 0, # 禁用状态 (0:激活 1:禁用)
- 'allow_at': 1708911388 # 注册审批时间时间戳
- }
- ]
- }
- """
- url = 'http://58.34.94.177:29101/v6/api'
- data = {
- 'code': 1003,
- 'uuid': '65db84b35e305885648ec062',
- }
- response = requests.post(url=url, json=data, headers={'authorization': token})
- print(response.json())
- url = 'http://58.34.94.177:29101/v6/api'
- data = {
- 'code': 1004,
- 'uuid': '65decb7744b74ae33732d813',
- }
- response = requests.post(url=url, json=data, headers={'authorization': token})
- print(response.json())
- url = 'http://58.34.94.177:29101/v6/api'
- data = {
- 'code': 1005,
- 'uuid': '65decb7744b74ae33732d813',
- }
- response = requests.post(url=url, json=data, headers={'authorization': token})
- print(response.json())
- url = 'http://58.34.94.177:29101/v6/api'
- data = {
- 'code': 1006,
- 'uuid': '65dd775c44b74ae33732d7f7',
- }
- response = requests.post(url=url, json=data, headers={'authorization': token})
- print(response.json())
- url = 'http://58.34.94.177:29101/v6/api'
- data = {
- 'code': 1007,
- 'uuid': '65dd775c44b74ae33732d7f7',
-
-
-
- 'name': 'aabbcc',
-
-
-
-
-
- }
- response = requests.post(url=url, json=data, headers={'authorization': token})
- print(response.json())
|