Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
e98523f8
Commit
e98523f8
authored
Jul 21, 2023
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auth
parent
9c260a30
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
6 deletions
+26
-6
ch-admin-api/src/main/java/com/wwdz/ch/admin/controller/AdminAuthController.java
...ava/com/wwdz/ch/admin/controller/AdminAuthController.java
+8
-6
ch-admin-api/src/main/java/com/wwdz/ch/admin/entity/request/LoginRequestDto.java
...ava/com/wwdz/ch/admin/entity/request/LoginRequestDto.java
+18
-0
No files found.
ch-admin-api/src/main/java/com/wwdz/ch/admin/controller/AdminAuthController.java
View file @
e98523f8
...
@@ -11,6 +11,8 @@ import java.util.Set;
...
@@ -11,6 +11,8 @@ import java.util.Set;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
com.wwdz.ch.admin.entity.request.LoginRequestDto
;
import
com.xxdxxs.utils.JsonUtils
;
import
org.apache.shiro.SecurityUtils
;
import
org.apache.shiro.SecurityUtils
;
import
org.apache.shiro.authc.AuthenticationException
;
import
org.apache.shiro.authc.AuthenticationException
;
import
org.apache.shiro.authc.LockedAccountException
;
import
org.apache.shiro.authc.LockedAccountException
;
...
@@ -60,13 +62,13 @@ public class AdminAuthController {
...
@@ -60,13 +62,13 @@ public class AdminAuthController {
* { username : value, password : value }
* { username : value, password : value }
*/
*/
@PostMapping
(
"/login"
)
@PostMapping
(
"/login"
)
public
Object
login
(
@RequestBody
String
body
)
{
public
Object
login
(
@RequestBody
LoginRequestDto
loginRequestDto
)
{
logger
.
info
(
"【请求开始】系统管理->用户登录,请求参数:body:{}"
,
body
);
logger
.
info
(
"【请求开始】系统管理->用户登录,请求参数:body:{}"
,
JsonUtils
.
from
(
loginRequestDto
)
);
String
username
=
JacksonUtil
.
parseString
(
body
,
"username"
);
String
username
=
loginRequestDto
.
getUsername
(
);
String
password
=
JacksonUtil
.
parseString
(
body
,
"password"
);
String
password
=
loginRequestDto
.
getPassword
(
);
String
code
=
JacksonUtil
.
parseString
(
body
,
"code"
);
String
code
=
loginRequestDto
.
getCode
(
);
String
uuid
=
JacksonUtil
.
parseString
(
body
,
"uuid"
);
String
uuid
=
loginRequestDto
.
getUuid
(
);
if
(
StringUtils
.
isEmpty
(
username
)
||
StringUtils
.
isEmpty
(
password
)
||
StringUtils
.
isEmpty
(
code
)
||
StringUtils
.
isEmpty
(
uuid
))
{
if
(
StringUtils
.
isEmpty
(
username
)
||
StringUtils
.
isEmpty
(
password
)
||
StringUtils
.
isEmpty
(
code
)
||
StringUtils
.
isEmpty
(
uuid
))
{
return
ResponseUtil
.
badArgument
();
return
ResponseUtil
.
badArgument
();
...
...
ch-admin-api/src/main/java/com/wwdz/ch/admin/entity/request/LoginRequestDto.java
0 → 100644
View file @
e98523f8
package
com.wwdz.ch.admin.entity.request
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
@Data
public
class
LoginRequestDto
implements
Entity
{
private
String
username
;
private
String
password
;
private
String
code
;
private
String
uuid
;
}
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