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
d2a9f666
Commit
d2a9f666
authored
Sep 17, 2020
by
WeiCong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化验证码失效策略
parent
84a7c0d7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletions
+7
-1
LoginController.java
...org/sss/presentation/noui/controller/LoginController.java
+1
-0
VerifyCodeCreateController.java
...sentation/noui/controller/VerifyCodeCreateController.java
+2
-1
RedisUtil.java
src/main/java/org/sss/presentation/noui/util/RedisUtil.java
+4
-0
No files found.
src/main/java/org/sss/presentation/noui/controller/LoginController.java
View file @
d2a9f666
...
...
@@ -60,6 +60,7 @@ public class LoginController {
map
.
put
(
"j_dncode"
,
dncode
);
map
.
put
(
"j_sendcode"
,
sendcode
);
map
.
put
(
"j_verifycode"
,
verifycode
);
RedisUtil
.
delete
(
kb
);
context
=
NoUiContextManager
.
createNoUiContext
(
noUiRequest
);
if
(
context
.
getSession
().
login
(
map
))
{
...
...
src/main/java/org/sss/presentation/noui/controller/VerifyCodeCreateController.java
View file @
d2a9f666
...
...
@@ -30,6 +30,7 @@ public class VerifyCodeCreateController {
private
static
final
Log
log
=
LogFactory
.
getLog
(
VerifyCodeCreateController
.
class
);
private
static
final
int
width
=
100
;
//验证码图片宽度
private
static
final
int
height
=
50
;
//验证码图片高度
private
static
final
int
vcsessionout
=
120
;
//验证码超时时间
@Autowired
private
NoUiVersion
noUiVersion
;
...
...
@@ -73,7 +74,7 @@ public class VerifyCodeCreateController {
}
String
kb
=
key
.
toString
().
toLowerCase
();
log
.
info
(
"key==="
+
kb
);
RedisUtil
.
set
(
kb
,
codes
.
toString
());
RedisUtil
.
set
(
kb
,
codes
.
toString
()
,
vcsessionout
);
// request.getSession().setAttribute(Constants.VERIFYCODE, codes.toString());
ImageIO
.
write
(
bi
,
"JPG"
,
response
.
getOutputStream
());
...
...
src/main/java/org/sss/presentation/noui/util/RedisUtil.java
View file @
d2a9f666
...
...
@@ -87,6 +87,10 @@ public class RedisUtil {
}
public
static
void
set
(
String
key
,
Object
value
)
throws
Exception
{
set
(
key
,
value
,
sessionTimeOut
);
}
public
static
void
set
(
String
key
,
Object
value
,
int
sessionTimeOut
)
throws
Exception
{
checkRedisNodeAvailable
();
getRedisConnection
().
opsForValue
().
set
(
key
,
value
);
...
...
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