Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
InterfaceAutoTest
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TestAuto
InterfaceAutoTest
Commits
44ad1fe4
Commit
44ad1fe4
authored
May 06, 2021
by
taoke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整读取excle
parent
5e278232
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
3 deletions
+37
-3
config.py
+7
-0
service/login.py
+30
-3
No files found.
config.py
View file @
44ad1fe4
...
...
@@ -2,6 +2,8 @@ class BaseConfig():
"""基础配置类"""
# 请求头
headers
=
{
'Content-Type'
:
'application/json; charset=utf-8'
}
bmy_testHost
=
"http://testyun.banmago.com/api"
class
DingTalk
(
BaseConfig
):
...
...
@@ -12,3 +14,8 @@ class DingTalk(BaseConfig):
class
SSOLoginConfig
(
BaseConfig
):
"""登录配置"""
salt
=
'hikcreate_xj'
service/login.py
View file @
44ad1fe4
...
...
@@ -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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment