|
|
@@ -16,6 +16,7 @@ import com.usky.system.domain.SysMobileTenantConfig;
|
|
|
import com.usky.system.domain.SysUser;
|
|
|
import com.usky.system.mapper.SysUserMapper;
|
|
|
import com.usky.system.service.ISysUserService;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import com.usky.system.service.SysMobileTenantConfigService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
@@ -47,13 +48,22 @@ public class SendSmsController {
|
|
|
@Autowired
|
|
|
private ISysUserService sysUserService;
|
|
|
|
|
|
+ @Value("${sms.ali.region-id}")
|
|
|
+ private String regionId;
|
|
|
+
|
|
|
+ @Value("${sms.ali.access-key-id}")
|
|
|
+ private String accessKeyId;
|
|
|
+
|
|
|
+ @Value("${sms.ali.access-key-secret}")
|
|
|
+ private String accessKeySecret;
|
|
|
+
|
|
|
@GetMapping("/noteSending")
|
|
|
public ApiResult<Void> noteSending(@RequestParam(value = "tenantId" ,required = false) Integer tenantId,@RequestParam(value = "phone") String phone) {
|
|
|
if((tenantId != null) && !StringUtils.isBlank(phone)){
|
|
|
sysUserService.getAppUserInfo(null, tenantId, phone,null);
|
|
|
}
|
|
|
|
|
|
- DefaultProfile profile = DefaultProfile.getProfile("cn-beijing", "LTAI9WERPIFIlHDg", "p7SQ0rYpraebcdoJ0l3tOtYmmgrR4q");
|
|
|
+ DefaultProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret);
|
|
|
String code = String.valueOf(new Random().nextInt(1000000));
|
|
|
redisHelper.set(phone,code,300,TimeUnit.SECONDS);//key为手机号,value为验证码存储
|
|
|
IAcsClient client = new DefaultAcsClient(profile);
|