Merge remote-tracking branch 'origin/master'

This commit is contained in:
guixinman
2025-06-18 14:36:30 +08:00
3 changed files with 8 additions and 2 deletions

View File

@@ -23,10 +23,10 @@ public class LitePhoneAuthDTO extends AuthCodeDTO implements Serializable{
private static final long serialVersionUID = 2022092915168090246L; private static final long serialVersionUID = 2022092915168090246L;
@ApiModelProperty("包括敏感数据在内的完整用户信息的加密数据") @ApiModelProperty("包括敏感数据在内的完整用户信息的加密数据")
@NotBlank(message = "加密数据不能为空") // @NotBlank(message = "加密数据不能为空")
private String encryptedData; private String encryptedData;
@ApiModelProperty("加密算法的初始向量") @ApiModelProperty("加密算法的初始向量")
@NotBlank(message = "加密向量不能为空") // @NotBlank(message = "加密向量不能为空")
private String iv; private String iv;
@ApiModelProperty("获取手机号的code(微信小程序)") @ApiModelProperty("获取手机号的code(微信小程序)")
private String phoneCode; private String phoneCode;

View File

@@ -258,6 +258,9 @@ public class AuthClientServiceImpl implements AuthClientService {
&& StringUtils.isNotBlank(phoneCode)) { && StringUtils.isNotBlank(phoneCode)) {
phone = this.getPhone(authClientDataDTO, phoneCode); phone = this.getPhone(authClientDataDTO, phoneCode);
} else { } else {
Assert.isTrue(
StringUtils.isNotBlank(litePhoneAuthDTO.getEncryptedData()) && StringUtils.isNotBlank(
litePhoneAuthDTO.getIv()), "加密数据不能为空");
CodeToSessionDTO codeToSessionDTO = CodeToSessionDTO codeToSessionDTO =
this.getCodeToSessionDTO(authClientDataDTO, litePhoneAuthDTO.getCode()); this.getCodeToSessionDTO(authClientDataDTO, litePhoneAuthDTO.getCode());
LiteUserPhoneDTO liteUserPhoneDTO = LiteEncryptor.decrypt(litePhoneAuthDTO.getEncryptedData(), LiteUserPhoneDTO liteUserPhoneDTO = LiteEncryptor.decrypt(litePhoneAuthDTO.getEncryptedData(),

View File

@@ -106,6 +106,9 @@ public class LitePhoneLoginProvider {
&& StringUtils.isNotBlank(phoneCode)) { && StringUtils.isNotBlank(phoneCode)) {
phone = authClientService.getPhone(authClientDataDTO, phoneCode); phone = authClientService.getPhone(authClientDataDTO, phoneCode);
} else { } else {
Assert.isTrue(
StringUtils.isNotBlank(litePhoneLoginDTO.getEncryptedData()) && StringUtils.isNotBlank(
litePhoneLoginDTO.getIv()), "加密数据不能为空");
LiteUserPhoneDTO liteUserPhoneDTO = LiteEncryptor.decrypt(litePhoneLoginDTO.getEncryptedData(), LiteUserPhoneDTO liteUserPhoneDTO = LiteEncryptor.decrypt(litePhoneLoginDTO.getEncryptedData(),
litePhoneLoginDTO.getIv(), codeToSessionDTO.getSessionKey(), LiteUserPhoneDTO.class); litePhoneLoginDTO.getIv(), codeToSessionDTO.getSessionKey(), LiteUserPhoneDTO.class);
phone = liteUserPhoneDTO.getPhoneNumber(); phone = liteUserPhoneDTO.getPhoneNumber();