Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
test-platform
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
马博
test-platform
Commits
88a78ed3
Commit
88a78ed3
authored
Nov 03, 2018
by
马博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hdcommon
parent
3fa9d5b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
Authorization.java
src/test/java/http/service/Authorization.java
+10
-5
No files found.
src/test/java/http/service/Authorization.java
View file @
88a78ed3
...
...
@@ -55,7 +55,7 @@ public class Authorization {
private
static
Map
<
String
,
String
>
hdCookies
;
private
static
Map
<
String
,
String
>
hdCookiesMabo
;
private
static
Map
<
String
,
String
>
hdCookiesSaas
;
private
static
Map
<
String
,
String
>
hdCookiesCommon
;
private
static
Map
<
String
,
Map
>
hdCookiesCommon
=
new
ConcurrentHashMap
<>()
;
private
static
Map
<
String
,
String
>
openbsCookies
;
private
Map
<
String
,
String
>
ssoCookies
=
null
;
...
...
@@ -264,7 +264,8 @@ public class Authorization {
//密码为duibaduiba123
public
Map
hdLoginCommon
(
String
email
){
int
i
=
10
;
while
((
hdCookiesCommon
==
null
||
hdCookiesCommon
.
size
()==
0
)&&
i
>
0
)
{
Map
<
String
,
String
>
hdCookies
=
hdCookiesCommon
.
get
(
email
);
while
((
hdCookies
==
null
||
hdCookies
.
size
()==
0
)&&
i
>
0
)
{
Response
token
=
this
.
hdGetToken
();
String
url
=
PROTOCOL
+
hdHost
+
hdLoginPath
;
Map
<
String
,
String
>
cookies
=
token
.
getCookies
();
...
...
@@ -274,13 +275,17 @@ public class Authorization {
paras
.
put
(
"redirect"
,
"/redirectApp"
);
paras
.
put
(
"isAutoLogin"
,
"true"
);
Response
response
=
given
().
cookies
(
cookies
).
params
(
paras
).
post
(
url
);
hdCookiesCommon
=
new
HashMap
<>(
response
.
getCookies
());
hdCookies
=
new
HashMap
<>(
response
.
getCookies
());
if
(
hdCookies
==
null
||
hdCookies
.
size
()==
0
){
hdCookies
.
remove
(
"csrf_token"
);
hdCookiesCommon
.
put
(
email
,
hdCookies
);
}
i
--;
}
//取消安全校验
hdCookiesCommon
.
remove
(
"csrf_token"
);
// logger.info(hdCookies);
return
hdCookies
Common
;
return
hdCookies
;
}
public
Response
hdGetToken
(){
...
...
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