应抛出 SysException。

feature/menu-mng
ZhouXY108 2023-04-04 00:54:15 +08:00
parent fcdf69026f
commit e4b06d8b2d
1 changed files with 2 additions and 3 deletions

View File

@ -8,9 +8,8 @@ import javax.annotation.Nonnull;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import xyz.zhouxy.plusone.commons.constant.PatternConsts; import xyz.zhouxy.plusone.commons.constant.PatternConsts;
import xyz.zhouxy.plusone.constant.ErrorCodeConsts;
import xyz.zhouxy.plusone.domain.IValueObject; import xyz.zhouxy.plusone.domain.IValueObject;
import xyz.zhouxy.plusone.exception.BizException; import xyz.zhouxy.plusone.exception.SysException;
import xyz.zhouxy.plusone.system.util.PasswordUtil; import xyz.zhouxy.plusone.system.util.PasswordUtil;
/** /**
@ -37,7 +36,7 @@ public class Password implements IValueObject {
} }
var salt = PasswordUtil.generateRandomSalt(); var salt = PasswordUtil.generateRandomSalt();
if (salt == null) { if (salt == null) {
throw new BizException(ErrorCodeConsts.DEFAULT_ERROR_CODE, "未知错误:生成随机盐失败"); throw new SysException("未知错误:生成随机盐失败");
} }
this.saltVal = salt; this.saltVal = salt;
this.passwordVal = PasswordUtil.hashPassword(password, salt); this.passwordVal = PasswordUtil.hashPassword(password, salt);