Forráskód Böngészése

添加密码重试,密码错误5次后,锁定10分钟-2

wangjiang988 2 éve
szülő
commit
2f83403435

+ 13 - 13
src/main/java/platform/config/shiro/ShiroConfig.java

@@ -196,19 +196,19 @@ public class ShiroConfig {
         return authenticationRealm;
     }
 
-    /**
-     * 凭证匹配器 指定密码匹配规则
-     *
-     * @return
-     */
-    @Bean(name = "hashedCredentialsMatcher")
-    public HashedCredentialsMatcher getHashedCredentialsMatcher() {
-        CredentialsMatcher credentialsMatcher = new CredentialsMatcher();
-        credentialsMatcher.setHashAlgorithmName("MD5");//散列算法:这里使用MD5算法;
-        credentialsMatcher.setHashIterations(1); //散列的次数,比如散列两次,相当于 md5(md5(""));
-        credentialsMatcher.setStoredCredentialsHexEncoded(true);
-        return credentialsMatcher;
-    }
+//    /**
+//     * 凭证匹配器 指定密码匹配规则
+//     *
+//     * @return
+//     */
+//    @Bean(name = "hashedCredentialsMatcher")
+//    public HashedCredentialsMatcher getHashedCredentialsMatcher() {
+//        CredentialsMatcher credentialsMatcher = new CredentialsMatcher();
+//        credentialsMatcher.setHashAlgorithmName("MD5");//散列算法:这里使用MD5算法;
+//        credentialsMatcher.setHashIterations(1); //散列的次数,比如散列两次,相当于 md5(md5(""));
+//        credentialsMatcher.setStoredCredentialsHexEncoded(true);
+//        return credentialsMatcher;
+//    }
 
     /**
      * Shiro生命周期处理器

+ 1 - 1
src/main/java/platform/config/shiro/ShiroKit.java

@@ -29,7 +29,7 @@ public class ShiroKit {
     /**
      * 循环次数
      */
-    public final static int HASHITERATIONS = 1024;
+    public final static int HASHITERATIONS = 1;
 
     /**
      * 验证是否同一个账号重新登录的属性,为true代表是重新登录, 初始化为false,代表不是重新登录