This commit is contained in:
2026-02-04 16:57:36 +08:00
parent 7d48faca11
commit c95046c600
116 changed files with 114 additions and 69198 deletions

View File

@@ -65,8 +65,6 @@ public class AliyunDynpsService {
throw new RuntimeException(SmsCodeEnum.getByCode(bodyCode).getMessage());
}
return Boolean.TRUE;
} catch (TeaException te) {
// 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
// 错误 message
@@ -74,22 +72,20 @@ public class AliyunDynpsService {
// 诊断地址
log.error("发送短信验证码诊断地址: [{}]", te.getData().get("Recommend"));
throw new RuntimeException(SmsCodeEnum.getByCode(te.code).getMessage());
throw new RuntimeException(te.getMessage());
} catch (Exception e) {
TeaException error = new TeaException(e.getMessage(), e);
// 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
// 错误 message
log.error("发送短信验证码TeaException错误 message: [{}]", error.getMessage());
// 诊断地址
throw new RuntimeException(SmsCodeEnum.getByCode(error.code).getMessage());
throw new RuntimeException(error.getMessage());
}
}
public Boolean verifySms(String phone, String code) {
CheckSmsVerifyCodeRequest sendSmsVerifyCodeRequest = new com.aliyun.dypnsapi20170525.models.CheckSmsVerifyCodeRequest();
CheckSmsVerifyCodeRequest sendSmsVerifyCodeRequest = new CheckSmsVerifyCodeRequest();
sendSmsVerifyCodeRequest.setPhoneNumber(phone);
sendSmsVerifyCodeRequest.setVerifyCode(code);
@@ -103,16 +99,14 @@ public class AliyunDynpsService {
log.error("验证短信验证码失败: [{}]", response.getBody().getMessage());
throw new RuntimeException(response.getBody().getMessage());
}
return Boolean.TRUE;
} catch (TeaException te) {
// 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
// 错误 message
log.error("验证短信验证码错误 message: [{}]", te.getMessage());
// 诊断地址
log.error("验证短信验证码地址: [{}]", te.getData().get("Recommend"));
throw new RuntimeException("短信验证码验证失败");
throw new RuntimeException(te.getMessage());
} catch (Exception e) {
TeaException error = new TeaException(e.getMessage(), e);
// 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
@@ -120,8 +114,7 @@ public class AliyunDynpsService {
log.error("验证短信验证码TeaException错误 message: [{}]", error.getMessage());
// 诊断地址
log.error("验证短信验证码TeaException诊断地址: [{}]", error.getData().get("Recommend"));
throw new RuntimeException("短信验证码验证失败");
throw new RuntimeException(error.getMessage());
}
}