Commit 44ad1fe4 by taoke

调整读取excle

parent 5e278232
......@@ -2,6 +2,8 @@ class BaseConfig():
"""基础配置类"""
# 请求头
headers = {'Content-Type': 'application/json; charset=utf-8'}
bmy_testHost = "http://testyun.banmago.com/api"
class DingTalk(BaseConfig):
......@@ -11,4 +13,9 @@ class DingTalk(BaseConfig):
class SSOLoginConfig(BaseConfig):
"""登录配置"""
salt = 'hikcreate_xj'
\ No newline at end of file
salt = 'hikcreate_xj'
......@@ -5,10 +5,37 @@ def sso_login():
pass
def bmy_login():
def bmy_login(indta, getToken=True):
"""企业云登录"""
"""kkkk"""
pass
url = f'{HOST}/auth/login'
# token加密
authorization = get_authorization()
header = {"Authorization": authorization}
payload = {"username": "", "password": "", "imageId": "", "grant_type": "passwordImageCode", "imageCode": ""}
# 账号
payload['username'] = indata['username']
# 密码加密
password_Encrypted = pwd_encrypted(indata['password'])
payload['password'] = password_Encrypted
# 获取图片信息
imageinfo = get_imageCode(payload['username'], payload['password'])
payload['imageId'] = imageinfo[0]
payload['imageCode'] = imageinfo[1]
# print("我是header:",header)
# print('我是url:',url)
# print('我是payload:',payload)
# # 请求
resp = requests.post(url, data=payload, headers=header)
if getToken:
token = resp.json()['data']['token'] # 数据权限会藏在token中
return get_authorization(defaultToken=token)
else:
return resp.json()
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