Skip to content

Commit

Permalink
🎨 优化配置文件中参数名称
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaojun1998 committed Jul 18, 2019
1 parent fa3c3d5 commit d8d55f7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/java/im/zhaojun/common/aop/LoginLogAspect.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

@Aspect
@Component
@ConditionalOnProperty(value = "log.login", havingValue = "true")
@ConditionalOnProperty(value = "shiro-action.log.login", havingValue = "true")
public class LoginLogAspect {

@Resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
@Aspect
@Component
@ConditionalOnProperty(value = "log.operation", havingValue = "true")
@ConditionalOnProperty(value = "shiro-action.log.operation", havingValue = "true")
public class OperationLogAspect {

@Resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public boolean doCredentialsMatch(AuthenticationToken token,
throw new ExcessiveAttemptsException();
}

opsForValue.set(key, retryCount, shiroActionProperties.getRetryTimeout(), TimeUnit.SECONDS);
Integer retryTimeout = shiroActionProperties.getRetryTimeout() == null ? 300 : shiroActionProperties.getRetryTimeout();
opsForValue.set(key, retryCount, retryTimeout, TimeUnit.SECONDS);
}

boolean matches = super.doCredentialsMatch(token, info);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"properties": [
{
"name": "log.operation",
"name": "shiro-action.log.operation",
"type": "java.lang.Boolean",
"defaultValue": false,
"description": "是否记录操作日志."
},
{
"name": "log.login",
"name": "shiro-action.log.login",
"type": "java.lang.Boolean",
"defaultValue": false,
"description": "是否记录登录日志."
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ spring.mvc.throw-exception-if-no-handler-found=true
spring.resources.add-mappings=true
spring.thymeleaf.cache=false

log.operation = false
log.login = false
shiro-action.log.operation = false
shiro-action.log.login = false

shiro-action.super-admin-username=admin
shiro-action.retry-count=5
Expand Down

0 comments on commit d8d55f7

Please sign in to comment.