Authored by zhaoyue

Merge branch 'zhaoyue-dev3' into 'master'

Zhaoyue dev3



See merge request !33
... ... @@ -2,8 +2,8 @@ git pull
git add --all src/main/java/*
git add push.sh
git add pom.xml
git commit -m "rm trim"
git commit -m "MOD admin pass"
#git push origin master
git push origin zhaoyue-dev2
git push origin zhaoyue-dev3
git status
git pull
... ...
... ... @@ -58,8 +58,13 @@ public class AdminAccountController {
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);
// String calcuPass = SecurityTool.getPassword(account, password, salt);
if (!calcuPass.equals(pass_in_db) ||//密码错误
admin.getStatus() != 1) {//用户无效
//提示用户名或密码错误
... ...
... ... @@ -11,6 +11,7 @@ import java.util.Random;
*/
public class SecurityTool {
private static final String ALGORITHM = "SHA1";
public static final String ALGORITHM_MD5 = "MD5";
private static final char[] HEX_DIGITS = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd',
'e', 'f' };
... ...