From c427ed3db05c772cec3658949e19bcf1b6c0d2a7 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期二, 22 八月 2023 15:03:16 +0800
Subject: [PATCH] 改动5.0
---
user-server/src/main/java/com/yuanchu/limslaboratory/shiro/realm/ShiroRealm.java | 18 ++----------------
1 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/user-server/src/main/java/com/yuanchu/limslaboratory/shiro/realm/ShiroRealm.java b/user-server/src/main/java/com/yuanchu/limslaboratory/shiro/realm/ShiroRealm.java
index ec429f4..24b24b1 100644
--- a/user-server/src/main/java/com/yuanchu/limslaboratory/shiro/realm/ShiroRealm.java
+++ b/user-server/src/main/java/com/yuanchu/limslaboratory/shiro/realm/ShiroRealm.java
@@ -2,10 +2,8 @@
import com.yuanchu.limslaboratory.pojo.User;
import com.yuanchu.limslaboratory.service.UserService;
-import com.yuanchu.limslaboratory.utils.MyUtils;
-import com.yuanchu.limslaboratory.utils.SpringUtils;
+import com.yuanchu.limslaboratory.utils.SpringUtil;
import org.apache.shiro.authc.*;
-import org.apache.shiro.authc.credential.CredentialsMatcher;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;
@@ -32,24 +30,12 @@
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken) {
String principal = (String) authenticationToken.getPrincipal();
//鑾峰彇UserService瀵硅薄
- UserService userService = SpringUtils.getBean(UserService.class);
+ UserService userService = SpringUtil.getBean(UserService.class);
user = userService.AccordingUsernameSelectAll(principal);
- MyUtils.PrintLog(user.toString());
if (!ObjectUtils.isEmpty(user)) {
return new SimpleAuthenticationInfo(user.getAccount(), user.getPassword(), this.getName());
} else {
throw new UnknownAccountException();
}
- }
-
- @Override
- public void setCredentialsMatcher(CredentialsMatcher credentialsMatcher) {
-// HashedCredentialsMatcher hashedCredentialsMatcher = new HashedCredentialsMatcher();
-// //璁剧疆浣跨敤MD5鍔犲瘑绠楁硶
-// hashedCredentialsMatcher.setHashAlgorithmName(Md5Hash.ALGORITHM_NAME);
-// //鏁e垪娆℃暟
-// hashedCredentialsMatcher.setHashIterations(1024);
-// super.setCredentialsMatcher(hashedCredentialsMatcher);
- super.setCredentialsMatcher(credentialsMatcher);
}
}
--
Gitblit v1.9.3