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
dfc9ab82
Commit
dfc9ab82
authored
Sep 16, 2020
by
WeiCong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台验证码支持集群模式
parent
9c731c0d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
101 additions
and
102 deletions
+101
-102
LoginController.java
...org/sss/presentation/noui/controller/LoginController.java
+96
-98
VerifyCodeCreateController.java
...sentation/noui/controller/VerifyCodeCreateController.java
+5
-4
No files found.
src/main/java/org/sss/presentation/noui/controller/LoginController.java
View file @
dfc9ab82
This diff is collapsed.
Click to expand it.
src/main/java/org/sss/presentation/noui/controller/VerifyCodeCreateController.java
View file @
dfc9ab82
...
...
@@ -10,15 +10,14 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
org.sss.presentation.noui.api.response.ErrorCodes
;
import
org.sss.presentation.noui.api.response.NoUiVersion
;
import
org.sss.presentation.noui.api.response.ResultUtil
;
import
org.sss.presentation.noui.common.Constants
;
import
org.sss.presentation.noui.util.NoUiUtils
;
import
org.sss.presentation.noui.util.RedisUtil
;
import
javax.imageio.ImageIO
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.awt.*
;
import
java.awt.image.BufferedImage
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Random
;
...
...
@@ -67,9 +66,11 @@ public class VerifyCodeCreateController {
g
.
drawString
(
code
,
(
i
*
18
)
+
10
,
30
);
codes
.
append
(
code
);
}
request
.
getSession
().
setAttribute
(
Constants
.
VERIFYCODE
,
codes
.
toString
());
RedisUtil
.
set
(
request
.
getRequestedSessionId
(),
codes
.
toString
());
// request.getSession().setAttribute(Constants.VERIFYCODE, codes.toString());
ImageIO
.
write
(
bi
,
"JPG"
,
response
.
getOutputStream
());
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"绘制登陆验证码异常"
,
e
);
}
finally
{
if
(
g
!=
null
){
...
...
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