Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nouiWithSpringMVC
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gechengyang
nouiWithSpringMVC
Commits
e7e3fb4c
Commit
e7e3fb4c
authored
Sep 09, 2020
by
tangzy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化ukey登录的条件
parent
40fe6771
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
28 deletions
+27
-28
UkeyLoginController.java
...sss/presentation/noui/controller/UkeyLoginController.java
+27
-28
No files found.
src/main/java/org/sss/presentation/noui/controller/UkeyLoginController.java
View file @
e7e3fb4c
...
@@ -31,48 +31,47 @@ public class UkeyLoginController {
...
@@ -31,48 +31,47 @@ public class UkeyLoginController {
private
NoUiParam
noUiParam
;
private
NoUiParam
noUiParam
;
private
static
final
Log
log
=
LogFactory
.
getLog
(
UkeyLoginController
.
class
);
private
static
final
Log
log
=
LogFactory
.
getLog
(
UkeyLoginController
.
class
);
@ResponseBody
@ResponseBody
@RequestMapping
(
value
=
"/getUserByDn"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/getUserByDn"
,
method
=
RequestMethod
.
POST
)
public
Object
ukeyLogin
(
@RequestBody
Map
<
String
,
Object
>
dataMap
,
HttpServletRequest
request
,
HttpServletResponse
reponse
)
throws
Exception
{
public
Object
ukeyLogin
(
@RequestBody
Map
<
String
,
Object
>
dataMap
,
HttpServletRequest
request
,
HttpServletResponse
reponse
)
throws
Exception
{
String
certdn
=
request
.
getHeader
(
"certdn"
);
String
certdn
=
request
.
getHeader
(
"certdn"
);
log
.
info
(
"====getUserByDn====certdn"
+
certdn
);
log
.
info
(
"====getUserByDn====certdn"
+
certdn
);
NoUiRequest
noUiRequest
=
new
NoUiRequest
(
request
,
""
,
dataMap
);
NoUiRequest
noUiRequest
=
new
NoUiRequest
(
request
,
""
,
dataMap
);
Map
<
String
,
Object
>
retDatamap
=
new
HashMap
<>();
Map
<
String
,
Object
>
retDatamap
=
new
HashMap
<>();
if
(
StringUtils
.
isNotBlank
(
certdn
))
if
(
StringUtils
.
isNotBlank
(
certdn
))
{
{
Map
<
String
,
Object
>
map
=
getLoginidByDN
(
certdn
,
noUiRequest
);
Map
<
String
,
Object
>
map
=
getLoginidByDN
(
certdn
,
noUiRequest
);
if
(
map
.
containsKey
(
"nam"
))
{
String
loginid
=
map
.
get
(
"nam"
).
toString
();
String
loginid
=
map
.
get
(
"nam"
).
toString
();
log
.
info
(
"====getUserByDn====loginid"
+
loginid
);
log
.
info
(
"====getUserByDn====loginid"
+
loginid
);
if
(
StringUtils
.
isNotBlank
(
loginid
))
if
(
StringUtils
.
isNotBlank
(
loginid
))
{
{
retDatamap
.
put
(
"msgCode"
,
"0000"
);
retDatamap
.
put
(
"msgCode"
,
"0000"
);
retDatamap
.
put
(
"loginid"
,
loginid
);
retDatamap
.
put
(
"loginid"
,
loginid
);
return
ResultUtil
.
result
(
ErrorCodes
.
SUCCESS
,
ErrorCodes
.
SUCCESS_INFO
,
retDatamap
,
noUiParam
.
getVersion
()
);
return
ResultUtil
.
result
(
ErrorCodes
.
SUCCESS
,
ErrorCodes
.
SUCCESS_INFO
,
retDatamap
,
noUiParam
.
getVersion
());
}
}
}
}
}
retDatamap
.
put
(
"msgCode"
,
"9999"
);
retDatamap
.
put
(
"msgCode"
,
"9999"
);
retDatamap
.
put
(
"loginid"
,
""
);
retDatamap
.
put
(
"loginid"
,
""
);
return
ResultUtil
.
result
(
ErrorCodes
.
SUCCESS
,
ErrorCodes
.
SUCCESS_INFO
,
retDatamap
,
noUiParam
.
getVersion
());
return
ResultUtil
.
result
(
ErrorCodes
.
SUCCESS
,
ErrorCodes
.
SUCCESS_INFO
,
retDatamap
,
noUiParam
.
getVersion
());
}
}
private
Map
<
String
,
Object
>
getLoginidByDN
(
String
certdn
,
NoUiRequest
noUiRequest
)
{
private
Map
<
String
,
Object
>
getLoginidByDN
(
String
certdn
,
NoUiRequest
noUiRequest
)
{
Map
<
String
,
Object
>
values
=
new
HashMap
<>();
Map
<
String
,
Object
>
values
=
new
HashMap
<>();
NoUiContext
context
=
NoUiContextManager
.
createNoUiContext
(
noUiRequest
);
NoUiContext
context
=
NoUiContextManager
.
createNoUiContext
(
noUiRequest
);
String
sql
=
"SELECT inr,nam,ukey FROM usr WHERE ukey=?"
;
String
sql
=
"SELECT inr,nam,ukey FROM usr WHERE ukey=?"
;
context
.
getSupport
().
execute
(
sql
,
new
Object
[]{
certdn
});
context
.
getSupport
().
execute
(
sql
,
new
Object
[]{
certdn
});
Argument
<
String
>
inr
=
new
Argument
<>(
"inr"
);
Argument
<
String
>
inr
=
new
Argument
<>(
"inr"
);
Argument
<
String
>
nam
=
new
Argument
<>(
"nam"
);
Argument
<
String
>
nam
=
new
Argument
<>(
"nam"
);
Argument
<
String
>
ukey
=
new
Argument
<>(
"ukey"
);
Argument
<
String
>
ukey
=
new
Argument
<>(
"ukey"
);
while
(
true
)
while
(
true
)
{
{
context
.
getSupport
().
fetch
(
new
IResult
[]{
inr
,
nam
,
ukey
});
context
.
getSupport
().
fetch
(
new
IResult
[]{
inr
,
nam
,
ukey
});
if
(
context
.
getError
()
!=
0
)
{
if
(
context
.
getError
()!=
0
)
{
context
.
getSupport
().
close
();
context
.
getSupport
().
close
();
return
values
;
return
values
;
}
}
values
.
put
(
"nam"
,
nam
.
getValue
());
values
.
put
(
"nam"
,
nam
.
getValue
());
values
.
put
(
"ukey"
,
ukey
.
getValue
());
values
.
put
(
"ukey"
,
ukey
.
getValue
());
}
}
}
}
}
}
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