diff --git a/src/main/java/shiro/shirorealm/CustomRealm.java b/src/main/java/shiro/shirorealm/CustomRealm.java
index 631f3ac..cf1acc5 100644
--- a/src/main/java/shiro/shirorealm/CustomRealm.java
+++ b/src/main/java/shiro/shirorealm/CustomRealm.java
@@ -37,6 +37,4 @@ protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authent
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) {
return null;
}
-
-
}
diff --git a/src/main/java/web/LoginController.java b/src/main/java/web/LoginController.java
index fd4a12d..be348a6 100644
--- a/src/main/java/web/LoginController.java
+++ b/src/main/java/web/LoginController.java
@@ -5,6 +5,7 @@
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.UsernamePasswordToken;
+import org.apache.shiro.crypto.hash.Md5Hash;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@@ -12,8 +13,10 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import service.ShiroUserService;
+import util.MD5Util;
import javax.servlet.http.HttpServletRequest;
+import java.rmi.activation.UnknownObjectException;
/**
* Created by xuweijie on 2017/3/3.
@@ -21,7 +24,7 @@
@Controller
public class LoginController {
- @RequestMapping(value = "/login",method = RequestMethod.GET)
+ @RequestMapping(value = "/login",method = RequestMethod.POST)
public String login(HttpServletRequest request, Model model){
CustomException customException=null;
String username=request.getParameter("username");
@@ -36,7 +39,6 @@ public String login(HttpServletRequest request, Model model){
}
if( subject.isAuthenticated()){
subject.logout();
- System.out.println("认证成功");
model.addAttribute("username",username);
return "/loginsuccess";
}else {
diff --git a/src/main/resources/spring/spring-shiro.xml b/src/main/resources/spring/spring-shiro.xml
index 5f1c7a2..1d64538 100644
--- a/src/main/resources/spring/spring-shiro.xml
+++ b/src/main/resources/spring/spring-shiro.xml
@@ -39,7 +39,6 @@