Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
civil-bigdata
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
civil
civil-bigdata
Commits
4ec094d4
Commit
4ec094d4
authored
Jan 13, 2022
by
韦华德
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
民政单点登录:增加登录验证码
parent
7567e436
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
sys-server/src/main/java/com/zq/system/modules/system/domain/vo/SsoLoginVo.java
+4
-0
sys-server/src/main/java/com/zq/system/modules/system/rest/SsoController.java
+14
-2
No files found.
sys-server/src/main/java/com/zq/system/modules/system/domain/vo/SsoLoginVo.java
View file @
4ec094d4
...
...
@@ -15,4 +15,8 @@ public class SsoLoginVo {
private
String
passwd
;
private
String
code
;
private
String
uuid
=
""
;
}
sys-server/src/main/java/com/zq/system/modules/system/rest/SsoController.java
View file @
4ec094d4
...
...
@@ -2,9 +2,12 @@ package com.zq.system.modules.system.rest;
import
com.zq.common.annotation.rest.AnonymousGetMapping
;
import
com.zq.common.annotation.rest.AnonymousPostMapping
;
import
com.zq.common.config.redis.RedisUtils
;
import
com.zq.common.utils.AssertUtils
;
import
com.zq.common.utils.StringUtils
;
import
com.zq.common.vo.IdVo
;
import
com.zq.common.vo.ResultVo
;
import
com.zq.system.exception.BadRequestException
;
import
com.zq.system.modules.system.domain.User
;
import
com.zq.system.modules.system.domain.vo.SsoLoginVo
;
import
com.zq.system.modules.system.domain.vo.SsoRegisterVo
;
...
...
@@ -28,7 +31,7 @@ import javax.servlet.http.HttpServletResponse;
@Api
(
tags
=
"单点登录"
)
@RequestMapping
(
"/sys/sso"
)
public
class
SsoController
{
private
final
RedisUtils
redisUtils
;
private
final
SsoService
ssoService
;
@ApiOperation
(
"单点登录"
)
...
...
@@ -36,7 +39,16 @@ public class SsoController {
public
ResultVo
login
(
@RequestBody
SsoLoginVo
vo
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
AssertUtils
.
hasText
(
vo
.
getUsername
(),
"用户名为空"
);
AssertUtils
.
hasText
(
vo
.
getPasswd
(),
"密码为空"
);
// 查询验证码
String
code
=
(
String
)
redisUtils
.
get
(
vo
.
getUuid
());
// 清除验证码
redisUtils
.
del
(
vo
.
getUuid
());
if
(
StringUtils
.
isBlank
(
code
))
{
throw
new
BadRequestException
(
"验证码不存在或已过期"
);
}
if
(
StringUtils
.
isBlank
(
vo
.
getCode
())
||
!
vo
.
getCode
().
equalsIgnoreCase
(
code
))
{
throw
new
BadRequestException
(
"验证码错误"
);
}
return
ResultVo
.
success
(
ssoService
.
login
(
vo
,
request
,
response
));
}
...
...
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