报的错误为
org.apache.shiro.authc.IncorrectCredentialsException: Submitted credentials for token [org.apache.shiro.authc.UsernamePasswordToken - admin, rememberMe=false] did not match the expected credentials.
我的数据库加密是 md5,而页面传过来的是明文。一般解决方案就是把页面传过来的密码进行加密处理。例如
MD5Utils.md5(entity.getPassword())。
但我进行加密处理后,依旧报了这个错误。后来才发现,在我的数据库里,有2条这样的数据。username相同,但密码一个是明文,一个是加密后的123.