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
1f1af7a0
Commit
1f1af7a0
authored
May 06, 2021
by
jiaqiying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
classs use self
parent
9b979203
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
common/utils/encryption.py
+5
-3
No files found.
common/utils/encryption.py
View file @
1f1af7a0
...
...
@@ -37,13 +37,15 @@ class Encryption:
return
encrypted_text_str
def
aes_token
(
self
,
token
):
"""bmc"""
key
=
"HIKEDL@#"
m5dkey
=
Encryption
()
.
get_md5
(
key
)
m5dkey
=
self
.
get_md5
(
key
)
token_plus_timestamp
=
token
+
str
(
int
(
round
(
time
.
time
()
*
1000
)))
encrypted_token
=
Encryption
()
.
aes_cipher
(
m5dkey
,
token_plus_timestamp
)
encrypted_token
=
self
.
aes_cipher
(
m5dkey
,
token_plus_timestamp
)
return
encrypted_token
def
get_token
(
self
,
indata
):
"""bmc"""
url
=
"http://testbmcapp.hikcreate.com/v1/user/login/gesture"
header
=
{
"Content-Type"
:
"application/json; charset=utf-8"
,
"device-type"
:
"Android"
,
...
...
@@ -55,7 +57,7 @@ class Encryption:
res
=
requests
.
post
(
url
,
json
=
indata
,
headers
=
header
)
print
(
res
.
json
())
encrypted_token
=
Encryption
()
.
aes_token
(
res
.
json
()[
"data"
][
"token"
])
encrypted_token
=
self
.
aes_token
(
res
.
json
()[
"data"
][
"token"
])
print
(
encrypted_token
)
# 获取专网token
header1
=
header
.
copy
()
...
...
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