Showing
1 changed file
with
2 additions
and
4 deletions
@@ -47,11 +47,9 @@ public class LoginServiceImpl implements ILoginService{ | @@ -47,11 +47,9 @@ public class LoginServiceImpl implements ILoginService{ | ||
47 | return null; | 47 | return null; |
48 | }else{ | 48 | }else{ |
49 | String salt = admin.getSalt(); | 49 | String salt = admin.getSalt(); |
50 | - String adminType = Integer.toString(admin.getType()); | ||
51 | - String str = admin.getAccount() + password + adminType + salt; // 构建待加密字符串 | ||
52 | - String calcuPass = SecurityTool.encode(SecurityTool.ALGORITHM_MD5, str); | ||
53 | String pass_in_db = admin.getPwd(); | 50 | String pass_in_db = admin.getPwd(); |
54 | - if (!calcuPass.equals(pass_in_db))//密码错误 | 51 | + String pass = SecurityTool.getPassword(username, password, salt); |
52 | + if (!pass.equals(pass_in_db))//密码错误 | ||
55 | return null; | 53 | return null; |
56 | } | 54 | } |
57 | return admin; | 55 | return admin; |
-
Please register or login to post a comment