要一直走下去

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

 

 

 

import requests
import json

session = requests.session()
url = "http://red-alert.testing.bbdops.com/api/v1.0/auth/sso/login?t=254901"
data = {
    "ip": "182.150.28.190",
    "location": "四川省成都市",
    "password": "91e287c2d0d7e5a72da1bf87e9c8cd84",
    "systemState": 1,
    "username": "前台专用权限测试号"
}
headers = {
    "Connection": "keep-alive",
    "Content-Encoding": "gzip",
    "Content-Type": "application/json;charset=UTF-8"
}
# 登录
response = session.post(url=url, data=json.dumps(data), headers=headers)
ret = json.loads(response.text)
print("登录成功:", ret.get('success'))
# 查对应的行业
url_industry = "http://red-alert.testing.bbdops.com/api/v1.0/auth/manage/user/industry-list"
response = session.get(url=url_industry, data=json.dumps({"t": 764245, "currentPageName": "首页"}))
ret = json.loads(response.text)
print("行业:", ret.get("data"))

 

posted on 2020-11-27 18:09  要一直走下去  阅读(205)  评论(0编辑  收藏  举报