Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
e65e82b3
Commit
e65e82b3
authored
Jun 07, 2022
by
Zheng Jie
Browse files
Merge branch 'master' into deploy
parents
615a4206
22c3864d
Changes
2
Hide whitespace changes
Inline
Side-by-side
eladmin-logging/src/main/java/me/zhengjie/service/impl/LogServiceImpl.java
View file @
e65e82b3
...
@@ -17,6 +17,7 @@ package me.zhengjie.service.impl;
...
@@ -17,6 +17,7 @@ package me.zhengjie.service.impl;
import
cn.hutool.core.lang.Dict
;
import
cn.hutool.core.lang.Dict
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
me.zhengjie.domain.Log
;
import
me.zhengjie.domain.Log
;
...
@@ -94,6 +95,12 @@ public class LogServiceImpl implements LogService {
...
@@ -94,6 +95,12 @@ public class LogServiceImpl implements LogService {
log
.
setMethod
(
methodName
);
log
.
setMethod
(
methodName
);
log
.
setUsername
(
username
);
log
.
setUsername
(
username
);
log
.
setParams
(
getParameter
(
method
,
joinPoint
.
getArgs
()));
log
.
setParams
(
getParameter
(
method
,
joinPoint
.
getArgs
()));
// 记录登录用户,隐藏密码信息
if
(
log
.
getDescription
().
equals
(
"用户登录"
)){
JSONObject
obj
=
JSONUtil
.
parseObj
(
log
.
getParams
());
log
.
setUsername
(
obj
.
get
(
"username"
).
toString
());
log
.
setParams
(
JSONUtil
.
toJsonStr
(
Dict
.
create
().
set
(
"username"
,
log
.
getUsername
())));
}
log
.
setBrowser
(
browser
);
log
.
setBrowser
(
browser
);
logRepository
.
save
(
log
);
logRepository
.
save
(
log
);
}
}
...
...
eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthorizationController.java
View file @
e65e82b3
...
@@ -21,6 +21,7 @@ import io.swagger.annotations.Api;
...
@@ -21,6 +21,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
me.zhengjie.annotation.Log
;
import
me.zhengjie.annotation.rest.AnonymousDeleteMapping
;
import
me.zhengjie.annotation.rest.AnonymousDeleteMapping
;
import
me.zhengjie.annotation.rest.AnonymousGetMapping
;
import
me.zhengjie.annotation.rest.AnonymousGetMapping
;
import
me.zhengjie.annotation.rest.AnonymousPostMapping
;
import
me.zhengjie.annotation.rest.AnonymousPostMapping
;
...
@@ -70,6 +71,7 @@ public class AuthorizationController {
...
@@ -70,6 +71,7 @@ public class AuthorizationController {
@Resource
@Resource
private
LoginProperties
loginProperties
;
private
LoginProperties
loginProperties
;
@Log
(
"用户登录"
)
@ApiOperation
(
"登录授权"
)
@ApiOperation
(
"登录授权"
)
@AnonymousPostMapping
(
value
=
"/login"
)
@AnonymousPostMapping
(
value
=
"/login"
)
public
ResponseEntity
<
Object
>
login
(
@Validated
@RequestBody
AuthUserDto
authUser
,
HttpServletRequest
request
)
throws
Exception
{
public
ResponseEntity
<
Object
>
login
(
@Validated
@RequestBody
AuthUserDto
authUser
,
HttpServletRequest
request
)
throws
Exception
{
...
...
Write
Preview
Supports
Markdown
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