修复登录失败的提示

This commit is contained in:
F嘉阳
2018-02-25 22:54:52 +08:00
parent 3e75e1753f
commit a154dff975
3 changed files with 63 additions and 4 deletions

View File

@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@@ -59,4 +60,14 @@ public class LoginController {
}
return "login";
}
@PostMapping("/beforeLogin")
@ResponseBody
public boolean beforeLogin(TbUser tbUser)throws Exception{
System.out.println(tbUser.toString());
//加密用户密码
tbUser.setColpassword(new BigInteger(CodingUtil.encryptSHA(tbUser.getColpassword().getBytes())).toString(32));
TbUser user = userService.doLoginService(tbUser.getColname(),tbUser.getColpassword());
return user!=null;
}
}