移除云片短信渠道,解决云片的安全风险

This commit is contained in:
YunaiV
2022-11-25 21:07:56 +08:00
parent 3c244fd44d
commit 583cb9388a
8 changed files with 3 additions and 44 deletions

View File

@@ -28,17 +28,6 @@ public class SmsCallbackController {
@Resource
private SmsSendService smsSendService;
@PostMapping("/yunpian")
@PermitAll
@ApiOperation(value = "云片短信的回调", notes = "参见 https://www.yunpian.com/official/document/sms/zh_cn/domestic_push_report 文档")
@ApiImplicitParam(name = "sms_status", value = "发送状态", required = true, example = "[{具体内容}]", dataTypeClass = String.class)
@OperateLog(enable = false)
public String receiveYunpianSmsStatus(@RequestParam("sms_status") String smsStatus) throws Throwable {
String text = URLUtil.decode(smsStatus); // decode 解码参数,因为它被 encode
smsSendService.receiveSmsStatus(SmsChannelEnum.YUN_PIAN.getCode(), text);
return "SUCCESS"; // 约定返回 SUCCESS 为成功
}
@PostMapping("/aliyun")
@PermitAll
@ApiOperation(value = "阿里云短信的回调", notes = "参见 https://help.aliyun.com/document_detail/120998.html 文档")

View File

@@ -30,22 +30,6 @@ public class SmsServiceIntegrationTest extends BaseDbAndRedisIntegrationTest {
@MockBean
private AdminUserService userService;
@Test
public void testSendSingleSms_yunpianSuccess() {
// 参数准备
String mobile = "15601691399";
Long userId = 1L;
Integer userType = UserTypeEnum.ADMIN.getValue();
String templateCode = "test_01";
Map<String, Object> templateParams = MapUtil.<String, Object>builder()
.put("operation", "登录").put("code", "1234").build();
// 调用
smsService.sendSingleSms(mobile, userId, userType, templateCode, templateParams);
// 等待 MQ 消费
ThreadUtil.sleep(1, TimeUnit.HOURS);
}
@Test
public void testSendSingleSms_aliyunSuccess() {
// 参数准备