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
07f344f5
Commit
07f344f5
authored
May 06, 2021
by
taoke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调试登录
parent
3cd456fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
config.py
+7
-2
service/login.py
+5
-9
No files found.
config.py
View file @
07f344f5
...
...
@@ -7,7 +7,7 @@ class BaseConfig():
# 当前运行的产品名
current_product
=
"bmc"
default_test_case_dir
=
"test_case/bmc/"
salt
=
'hikcreate_xj'
# SSO 登录的东西
class
BMCConfig
(
BaseConfig
):
"""斑马信用app的配置类"""
...
...
@@ -15,5 +15,10 @@ class BMCConfig(BaseConfig):
name
=
"bmc"
test_case_dir
=
"test_case/bmc/"
webhook
=
''
salt
=
'hikcreate_xj'
class
BmyConfig
(
BaseConfig
):
"""企业云的配置类"""
name
=
"bmy"
service/login.py
View file @
07f344f5
...
...
@@ -46,9 +46,7 @@ class BMY():
try
:
rep
=
requests
.
get
(
"http://testyun.banmago.com/api/website/common/graph/login-captcha"
,
params
=
payload
)
imageId
=
rep
.
json
()[
'data'
][
'jtId'
]
print
(
"imageID为"
,
imageId
)
result
=
RedisString
(
6
)
.
get
(
f
'bmc:captcha:{imageId}'
)
print
(
result
)
imageCode
=
str
(
result
)[
-
3
:
-
1
]
return
imageId
,
imageCode
except
:
...
...
@@ -72,7 +70,7 @@ class BMY():
imageinfo
=
BMY
()
.
get_imageCode
(
payload
[
'username'
],
payload
[
'password'
])
payload
[
'imageId'
]
=
imageinfo
[
0
]
payload
[
'imageCode'
]
=
imageinfo
[
1
]
print
(
payload
)
#
print(payload)
resp
=
requests
.
post
(
"http://testyun.banmago.com/api/auth/login"
,
data
=
payload
,
headers
=
header
)
if
getToken
:
...
...
@@ -90,11 +88,9 @@ if __name__ == '__main__':
# headers=getattr(BaseConfig, 'headers'),
# method='post',
# data=None)
# indata= {"username":"15150000000","password":"A123456"}
# token= BMY().bmy_login(indata,getToken=False)
# print(token)
indata
=
{
"username"
:
"15150000000"
,
"password"
:
"A123456"
}
token
=
BMY
()
.
bmy_login
(
indata
,
getToken
=
True
)
print
(
token
)
# res=BMY().get_imageCode("15150000000","8e4b595babec901009ff84f269ee5147")
# print(res)
BMY
()
.
get_imageCode
(
"15150000000"
,
"8e4b595babec901009ff84f269ee5147"
)
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