Commit 07f344f5 by taoke

调试登录

parent 3cd456fe
......@@ -7,7 +7,7 @@ class BaseConfig():
# 当前运行的产品名
current_product = "bmc"
default_test_case_dir = "test_case/bmc/"
salt = 'hikcreate_xj' # SSO 登录的东西
class BMCConfig(BaseConfig):
"""斑马信用app的配置类"""
......@@ -15,5 +15,10 @@ class BMCConfig(BaseConfig):
name = "bmc"
test_case_dir = "test_case/bmc/"
webhook = ''
salt = 'hikcreate_xj'
class BmyConfig(BaseConfig):
"""企业云的配置类"""
name = "bmy"
......@@ -46,9 +46,7 @@ class BMY():
try:
rep = requests.get("http://testyun.banmago.com/api/website/common/graph/login-captcha", params=payload)
imageId = rep.json()['data']['jtId']
print("imageID为",imageId)
result = RedisString(6).get(f'bmc:captcha:{imageId}')
print(result)
imageCode = str(result)[-3:-1]
return imageId, imageCode
except:
......@@ -72,7 +70,7 @@ class BMY():
imageinfo = BMY().get_imageCode(payload['username'], payload['password'])
payload['imageId'] = imageinfo[0]
payload['imageCode'] = imageinfo[1]
print(payload)
# print(payload)
resp = requests.post("http://testyun.banmago.com/api/auth/login", data=payload, headers=header)
if getToken:
......@@ -90,11 +88,9 @@ if __name__ == '__main__':
# headers=getattr(BaseConfig, 'headers'),
# method='post',
# data=None)
# indata= {"username":"15150000000","password":"A123456"}
# token= BMY().bmy_login(indata,getToken=False)
# print(token)
indata= {"username":"15150000000","password":"A123456"}
token= BMY().bmy_login(indata,getToken=True)
print(token)
# res=BMY().get_imageCode("15150000000","8e4b595babec901009ff84f269ee5147")
# print(res)
BMY().get_imageCode("15150000000", "8e4b595babec901009ff84f269ee5147")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment