This commit is contained in:
2023-02-19 04:21:39 +08:00
parent 92dbc613d2
commit 9293ba6817
16 changed files with 122 additions and 28 deletions

View File

@@ -5,7 +5,7 @@ import javax.annotation.Nonnull;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.crypto.digest.DigestUtil;
import xyz.zhouxy.plusone.constant.ErrorCodeConsts;
import xyz.zhouxy.plusone.exception.PlusoneException;
import xyz.zhouxy.plusone.exception.BizException;
/**
* 密码工具类
@@ -31,7 +31,7 @@ public final class PasswordUtil {
+ salt.substring(1);
String sha512Hex = DigestUtil.sha512Hex(passwordWithSalt);
if (sha512Hex == null) {
throw new PlusoneException(ErrorCodeConsts.DEFAULT_ERROR_CODE, "未知错误:哈希加密失败!");
throw new BizException(ErrorCodeConsts.DEFAULT_ERROR_CODE, "未知错误:哈希加密失败!");
}
return sha512Hex;
}