Authored by zhaoyue

Merge branch 'zhaoyue-dev3' into 'master'

MOD admin pass



See merge request !34
... ... @@ -68,8 +68,10 @@ public class UpSoftAccountController {
return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR), HttpStatus.OK);
}
String salt = admin.getSalt();
String adminType = Integer.toString(admin.getType());
String str = account + password + adminType + salt; // 构建待加密字符串
String calcuPass = SecurityTool.encode(SecurityTool.ALGORITHM_MD5, str);
String pass_in_db = admin.getPwd();
String calcuPass = SecurityTool.getPassword(account, password, salt);
if (!calcuPass.equals(pass_in_db) ||//密码错误
admin.getStatus() != 1) {//用户无效
//提示用户名或密码错误
... ...
... ... @@ -84,4 +84,12 @@ public class User {
public void setMemberId(long memberId) {
this.memberId = memberId;
}
public long getCreateTime() {
return createTime;
}
public void setCreateTime(long createTime) {
this.createTime = createTime;
}
}
... ...