Commit 9f5a9918 authored by Quxl's avatar Quxl

x

parent 473e3bc3
......@@ -146,8 +146,10 @@ public class AdminAuthServiceImpl implements AdminAuthService {
Fc_admin admin = this.queryAdminById(id);
String encodePassword = Common.encodePassword(password, admin.getSalt());
if(encodePassword.equals(admin.getPassword())) {
String encodeNewPassword = Common.encodePassword(newPassword, admin.getSalt());
return jdbcTemplate.executeUpdate("update fc_admin set password = ? where adminid = ?", encodeNewPassword, admin.getAdminid()) == 1;
String salt = Common.getGenerateString(6);
String encodeNewPassword = Common.encodePassword(newPassword, salt);
Integer count = jdbcTemplate.executeUpdate("update fc_admin set salt = ?, password = ? where adminid = ?", salt, encodeNewPassword, admin.getAdminid());
return count.intValue() == 1;
}
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment