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
4c0cfd3d
Commit
4c0cfd3d
authored
Dec 06, 2018
by
赵然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zr
parent
45efea03
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
14 deletions
+22
-14
Authorization.java
src/test/java/http/service/Authorization.java
+22
-14
No files found.
src/test/java/http/service/Authorization.java
View file @
4c0cfd3d
...
...
@@ -55,6 +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
,
Map
>
hdCookiesSaasByApp
=
new
ConcurrentHashMap
<>();
private
static
Map
<
String
,
Map
>
hdCookiesCommon
=
new
ConcurrentHashMap
<>();
private
static
Map
<
String
,
String
>
openbsCookies
;
private
Map
<
String
,
String
>
ssoCookies
=
null
;
...
...
@@ -247,22 +248,29 @@ public class Authorization {
}
public
Map
hdLoginSaas
(
String
appId
){
int
i
=
10
;
Map
<
String
,
String
>
hdCookies
=
hdCookiesSaasByApp
.
get
(
appId
);
while
((
hdCookies
==
null
||
hdCookies
.
size
()==
0
)&&
i
>
0
)
{
Response
token
=
this
.
hdGetToken
();
String
url
=
PROTOCOL
+
hdHost
+
hdLoginPath
;
Map
<
String
,
String
>
cookies
=
token
.
getCookies
();
Map
<
String
,
String
>
paras
=
new
HashMap
<>();
paras
.
put
(
"email"
,
"wxs@duiba.com.cn"
);
paras
.
put
(
"password"
,
SecurityUtils
.
getMD5
(
"dbZcFiIc5yMHcee/o/PJEfyZjug="
+
from
(
token
.
asString
()).
getString
(
"data.loginsToken"
)));
paras
.
put
(
"redirect"
,
"/redirectApp"
);
paras
.
put
(
"isAutoLogin"
,
"true"
);
Response
response
=
given
().
cookies
(
cookies
).
params
(
paras
).
post
(
url
);
hdCookies
=
new
HashMap
<>(
response
.
getCookies
());
Response
token
=
this
.
hdGetToken
();
String
url
=
PROTOCOL
+
hdHost
+
hdLoginPath
;
Map
<
String
,
String
>
cookies
=
token
.
getCookies
();
Map
<
String
,
String
>
paras
=
new
HashMap
<>();
paras
.
put
(
"email"
,
"wxs@duiba.com.cn"
);
paras
.
put
(
"password"
,
SecurityUtils
.
getMD5
(
"dbZcFiIc5yMHcee/o/PJEfyZjug="
+
from
(
token
.
asString
()).
getString
(
"data.loginsToken"
)));
paras
.
put
(
"redirect"
,
"/redirectApp"
);
paras
.
put
(
"isAutoLogin"
,
"true"
);
Response
response
=
given
().
cookies
(
cookies
).
params
(
paras
).
post
(
url
);
Map
<
String
,
String
>
hdCookiesSaasByApp
=
new
HashMap
<>(
response
.
getCookies
());
//取消安全校验
hdCookies
.
remove
(
"csrf_token"
);
hdCookies
.
put
(
"appId"
,
appId
);
hdCookies
.
put
(
"duibaAppId"
,
appId
);
hdCookiesSaasByApp
.
put
(
appId
,
hdCookies
);
//取消安全校验
hdCookiesSaasByApp
.
remove
(
"csrf_token"
);
hdCookiesSaasByApp
.
put
(
"appId"
,
appId
);
return
hdCookiesSaasByApp
;
i
--;
}
return
hdCookies
;
}
//密码为duibaduiba123
public
Map
hdLoginCommon
(
String
email
){
...
...
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