Commit 026c7355 by fanxun

SSO登录初步调试

parent 13cae9ed
......@@ -3,21 +3,13 @@
class BaseConfig():
"""基础配置类"""
# 请求头
headers = {'Content-Type': 'application/json; charset=utf-8'}
headers = {'Content-Type': 'application/json'}
# 当前运行的产品名
current_product = ""
webhook = ''
salt = 'hikcreate_xj'
class BMCConfig(BaseConfig):
"""斑马信用app的配置类"""
pass
\ No newline at end of file
class DingTalk(BaseConfig):
"""钉钉机器人"""
webhook = ''
class SSOLoginConfig(BaseConfig):
"""登录配置"""
salt = 'hikcreate_xj'
\ No newline at end of file
import pytest
import requests
from config import BaseConfig
from common.utils.encryption import Encryption
# from common.utils.getExcelData import get_excelData
from common.tools import request_main
@pytest.fixture(scope='session')
def sso_login(url, headers, method, data):
"""SSO登录"""
req_data = {"loginName":"fanxun","password":"fx123456"}
password = req_data['password']
md5_password = Encryption().get_md5(password, salt=BaseConfig.salt)
req_data['password'] = md5_password
res = request_main(url, headers, method, req_data)
print(res)
def sso_login():
"""sso登录"""
pass
def bmy_login():
......@@ -11,4 +24,12 @@ def bmy_login():
pass
if __name__ == '__main__':
# login = request_main(url=r'http://testtbdzj.hikcreate.com/web/auth/users/login',
# method='post',
# data={"loginName":"fanxun","password":"d67fac1d71943576b6c397d0cca166cb"},
# headers=getattr(BaseConfig, 'headers'))
sso_login(r'http://testtbdzj.hikcreate.com/web/auth/users/login',
headers=getattr(BaseConfig, 'headers'),
method='post',
data=None)
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