Commit 51266473 by taoke

Merge remote-tracking branch 'origin/master'

parents 03951650 6e5c8585
...@@ -20,7 +20,7 @@ class BaseConfig(): ...@@ -20,7 +20,7 @@ class BaseConfig():
sso_username = 'robot_fanxun' # SSO登录名 sso_username = 'robot_fanxun' # SSO登录名
sso_password = 'fx123456' # sso密码 sso_password = 'fx123456' # sso密码
sso_url = r'http://testtbdzj.hikcreate.com/web/auth/users/login' # sso登录地址 sso_url = r'http://testtbdzj.hikcreate.com/web/auth/users/login' # sso登录地址
salt = 'hikcreate_xj' # SSO盐值 sso_salt = 'hikcreate_xj' # SSO盐值
sso_token = '' sso_token = ''
......
...@@ -8,7 +8,7 @@ from common.tools import request_main ...@@ -8,7 +8,7 @@ from common.tools import request_main
@pytest.fixture(scope='module', autouse=True) @pytest.fixture(scope='module', autouse=True)
def sso_login(): def sso_login():
"""SSO登录获取token""" """SSO登录获取token"""
encrypted_password = Encryption().get_md5(BaseConfig.sso_password, salt=BaseConfig.salt) encrypted_password = Encryption().get_md5(BaseConfig.sso_password, salt=BaseConfig.sso_salt)
req_data = {"loginName": BaseConfig.sso_username, "password": encrypted_password} req_data = {"loginName": BaseConfig.sso_username, "password": encrypted_password}
res = request_main(BaseConfig.sso_url, headers=None, method='post', data=req_data) res = request_main(BaseConfig.sso_url, headers=None, method='post', data=req_data)
setattr(BaseConfig, 'sso_token', res['data']['token']) setattr(BaseConfig, 'sso_token', res['data']['token'])
...@@ -17,4 +17,3 @@ def sso_login(): ...@@ -17,4 +17,3 @@ def sso_login():
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