|
@@ -42,7 +42,7 @@ class APIMgr():
|
|
|
# session对象设置为全局变量
|
|
|
s = requests.Session()
|
|
|
GSTORE['s'] = s
|
|
|
- #登录接口
|
|
|
+ #pc登录接口
|
|
|
def mgr_login(self, phone='18211989987', password='123456',useproxies=False):
|
|
|
headers=GSTORE['headers']
|
|
|
s = GSTORE['s']
|
|
@@ -59,7 +59,27 @@ class APIMgr():
|
|
|
# 把response对象返回出去
|
|
|
return response
|
|
|
|
|
|
- """退出登录"""
|
|
|
+ # app登录接口
|
|
|
+ def mgr_login_app(self, phone='18211989987', password='123456',useproxies=False):
|
|
|
+ headers=GSTORE['headers']
|
|
|
+ s = GSTORE['s']
|
|
|
+ if useproxies:
|
|
|
+ self.s.proxies.update({'http':'127.0.0.1:8888'})
|
|
|
+ response = self.s.post(f"{cfg.target_host_app}/jyapp/free/login",headers=headers,params=
|
|
|
+ {
|
|
|
+ 'reqType': 'phoneLogin',
|
|
|
+ 'phone':phone,
|
|
|
+ 'password':password,
|
|
|
+ 'rid':'',
|
|
|
+ 'oid': '',
|
|
|
+ 'phoneType': '',
|
|
|
+ 'channel': '',
|
|
|
+ 'deviceId': ''
|
|
|
+ })
|
|
|
+ self.printResponse(response)
|
|
|
+ # 把response对象返回出去
|
|
|
+ return response
|
|
|
+ """退出登录pc"""
|
|
|
def mgr_logout(self):
|
|
|
url = f"{cfg.target_host}/front/signOut"
|
|
|
headers = GSTORE['headers']
|
|
@@ -67,6 +87,13 @@ class APIMgr():
|
|
|
s.post(url=url, headers=headers)
|
|
|
# self.printResponse(res)
|
|
|
# return res
|
|
|
+
|
|
|
+ """退出登录app"""
|
|
|
+ def mgr_logout_app(self):
|
|
|
+ url = f"{cfg.target_host_app}/jyapp/free/signOut"
|
|
|
+ headers = GSTORE['headers']
|
|
|
+ s = GSTORE['s']
|
|
|
+ s.post(url=url, headers=headers)
|
|
|
#招标搜索
|
|
|
def bidsearch(self, keywords="建筑", publishtime="fiveyear", selectType="content"):
|
|
|
#使用全局变量
|