新增 绑定鉴权卡需密钥

This commit is contained in:
Lemon
2023-03-28 14:31:31 +08:00
parent 515cfe869f
commit 358ece2923
13 changed files with 92 additions and 5 deletions

View File

@@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
@Service
@@ -289,6 +290,10 @@ public class MemberService {
// memberId 不为空,说明此卡已被绑定
throw new BusinessException(ReturnCodeEnum.CODE_THIS_CARD_HAS_BEEN_BINDING);
}
if (!StringUtils.equals(pileAuthCardInfo.getSecretKey(), dto.getSecretKey().toUpperCase(Locale.ROOT))) {
// 密钥不一致,不能绑定
throw new BusinessException(ReturnCodeEnum.CODE_SECRET_KEY_NOT_SAME);
}
authCard.setMemberId(dto.getMemberId());
authCard.setStatus("1"); // 1-正常使用
authCard.setCreateBy(dto.getMemberId());