File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
server/src/main/java/com/abc/shiro Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 8
8
import com .abc .vo .AuthVo ;
9
9
import com .baomidou .mybatisplus .mapper .EntityWrapper ;
10
10
import org .apache .shiro .authc .*;
11
+ import org .apache .shiro .authc .credential .CredentialsMatcher ;
11
12
import org .apache .shiro .authc .credential .HashedCredentialsMatcher ;
12
13
import org .apache .shiro .authz .AuthorizationException ;
13
14
import org .apache .shiro .authz .AuthorizationInfo ;
@@ -37,16 +38,16 @@ public class UserRealm extends AuthorizingRealm {
37
38
@ Autowired
38
39
private SysPermService permService ;
39
40
40
- {
41
+ @ Override
42
+ public void setCredentialsMatcher (CredentialsMatcher credentialsMatcher ) {
41
43
//设置用于匹配密码的CredentialsMatcher
42
44
HashedCredentialsMatcher hashMatcher = new HashedCredentialsMatcher ();
43
45
hashMatcher .setHashAlgorithmName (Sha256Hash .ALGORITHM_NAME );
44
46
hashMatcher .setStoredCredentialsHexEncoded (false );
45
47
hashMatcher .setHashIterations (1024 );
46
- this .setCredentialsMatcher (hashMatcher );
48
+ super .setCredentialsMatcher (hashMatcher );
47
49
}
48
50
49
-
50
51
@ Override
51
52
protected AuthorizationInfo doGetAuthorizationInfo (PrincipalCollection principals ) {
52
53
//null usernames are invalid
You can’t perform that action at this time.
0 commit comments