Commit 5a922638 by fanxun

Merge branch 'master' of D:\项目\接口自动化\InterfaceAutoTest with conflicts.

parent cb7c4838
......@@ -17,10 +17,12 @@ class BaseConfig():
webhook = ''
# SSO相关
username = 'fanxun' # SSO登录名
password = 'fx123456' # sso密码
sso_username = 'robot_fanxun' # SSO登录名
sso_password = 'fx123456' # sso密码
sso_url = r'http://testtbdzj.hikcreate.com/web/auth/users/login' # sso登录地址
salt = 'hikcreate_xj' # SSO盐值
sso_token = ''
class BMCConfig(BaseConfig):
......
......@@ -9,22 +9,6 @@ from common.db import RedisString
from config import BmyConfig
# @pytest.fixture(scope='session')
class SSOLogin():
"""SSO登录"""
def _sso_pwd_encrypted(self, org_pwd):
"""md5加密"""
encrypted_password = Encryption().get_md5(org_pwd, salt=BaseConfig.salt)
return encrypted_password
def sso_login(self,url, method, headers=None):
"""SSO登录获取token"""
encrypted_password = self._sso_pwd_encrypted(BaseConfig.password)
req_data = {f"loginName":BaseConfig.username,"password":encrypted_password}
res = request_main(url, headers, method, req_data)
return res['data']['token']
class BMY():
"""斑马云登录相关"""
# 获取当前时间的Authorization
......@@ -113,12 +97,7 @@ class BMY():
if __name__ == '__main__':
# # SSO登录测试
# sso_token = SSOLogin().sso_login(url=BaseConfig.sso_url,
# method='post',)
# print(sso_token)
# BMY登录
indata= BmyConfig.test_name_password
token= BMY().bmy_login(indata,getToken=False)
print(token)
# indata= {"username":"15150000000","password":"A123456"}
# token= BMY().bmy_login(indata,getToken=False)
# print(token)
pass
__author__ = 'fanxun'
__data__ = "2021-05-08 11:08"
\ No newline at end of file
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