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
JSH ERP
Commits
2b304137
Commit
2b304137
authored
Feb 24, 2022
by
季圣华
Browse files
解决登录时候日志记录的bug
parent
33fe6e80
Changes
5
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/config/TenantConfig.java
View file @
2b304137
...
...
@@ -77,6 +77,8 @@ public class TenantConfig {
return
true
;
}
else
if
(
"com.jsh.erp.datasource.mappers.RoleMapperEx.getRoleWithoutTenant"
.
equals
(
ms
.
getId
()))
{
return
true
;
}
else
if
(
"com.jsh.erp.datasource.mappers.logMapperEx.insertLogWithUserId"
.
equals
(
ms
.
getId
()))
{
return
true
;
}
return
false
;
}
...
...
jshERP-boot/src/main/java/com/jsh/erp/controller/UserController.java
View file @
2b304137
...
...
@@ -79,6 +79,7 @@ public class UserController {
User
user
=
null
;
BaseResponseInfo
res
=
new
BaseResponseInfo
();
try
{
String
loginName
=
userParam
.
getLoginName
().
trim
();
String
password
=
userParam
.
getPassword
().
trim
();
//判断用户是否已经登录过,登录过不再处理
...
...
jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/LogMapperEx.java
View file @
2b304137
...
...
@@ -33,4 +33,6 @@ public interface LogMapperEx {
@Param
(
"moduleName"
)
String
moduleName
,
@Param
(
"clientIp"
)
String
clientIp
,
@Param
(
"createTime"
)
String
createTime
);
int
insertLogWithUserId
(
Log
log
);
}
\ No newline at end of file
jshERP-boot/src/main/java/com/jsh/erp/service/log/LogService.java
View file @
2b304137
...
...
@@ -183,7 +183,7 @@ public class LogService {
log
.
setStatus
(
status
);
log
.
setContent
(
content
);
log
.
setTenantId
(
tenantId
);
logMapper
.
insert
Selective
(
log
);
logMapper
Ex
.
insert
LogWithUserId
(
log
);
}
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
...
...
jshERP-boot/src/main/resources/mapper_xml/LogMapperEx.xml
View file @
2b304137
...
...
@@ -77,4 +77,13 @@
<select
id=
"getCountByIpAndDate"
resultType=
"java.lang.Long"
>
select count(1) from jsh_log where operation=#{moduleName} and client_ip=#{clientIp} and create_time=#{createTime}
</select>
<insert
id=
"insertLogWithUserId"
parameterType=
"com.jsh.erp.datasource.entities.Log"
>
insert into jsh_log (user_id, operation,
client_ip, create_time, status,
content, tenant_id)
values (#{userId,jdbcType=BIGINT}, #{operation,jdbcType=VARCHAR},
#{clientIp,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=TINYINT},
#{content,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT})
</insert>
</mapper>
\ No newline at end of file
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