Authored by zhaoyue

Merge branch 'zhaoyue-dev3' into 'master'

MOD admin pass



See merge request !36
@@ -110,7 +110,9 @@ public class UpSoftAccountController { @@ -110,7 +110,9 @@ public class UpSoftAccountController {
110 public ResponseEntity<ResultModel> modpwd(@CurrentAdmin XklAdminEntity admin, @RequestParam String newpwd) { 110 public ResponseEntity<ResultModel> modpwd(@CurrentAdmin XklAdminEntity admin, @RequestParam String newpwd) {
111 Assert.notNull(newpwd, "password can not be empty"); 111 Assert.notNull(newpwd, "password can not be empty");
112 String salt = SecurityTool.genSalt(); 112 String salt = SecurityTool.genSalt();
113 - String pass2Db = SecurityTool.getPassword(admin.getAccount(), newpwd, salt); 113 + String adminType = Integer.toString(admin.getType());
  114 + String str = admin.getAccount() + newpwd + adminType + salt; // 构建待加密字符串
  115 + String pass2Db = SecurityTool.encode(SecurityTool.ALGORITHM_MD5, str);
114 admin.setPwd(pass2Db); 116 admin.setPwd(pass2Db);
115 admin.setSalt(salt); 117 admin.setSalt(salt);
116 adminRepository.save(admin); 118 adminRepository.save(admin);