阿里sms默认短信验证码配置问题处理
This commit is contained in:
parent
0fc179cff2
commit
6d7e9e7fdd
@ -212,6 +212,18 @@ jasypt:
|
||||
password: lili
|
||||
|
||||
lili:
|
||||
#短信模版配置
|
||||
sms:
|
||||
#登录
|
||||
LOGIN: SMS_205755300
|
||||
#注册
|
||||
REGISTER: SMS_205755298
|
||||
#找回密码
|
||||
FIND_USER: SMS_205755301
|
||||
#设置密码
|
||||
UPDATE_PASSWORD: SMS_205755297
|
||||
#支付密码
|
||||
WALLET_PASSWORD: SMS_205755301
|
||||
system:
|
||||
isDemoSite: true
|
||||
licences: 'temporary'
|
||||
|
@ -212,6 +212,18 @@ jasypt:
|
||||
password: lili
|
||||
|
||||
lili:
|
||||
#短信模版配置
|
||||
sms:
|
||||
#登录
|
||||
LOGIN: SMS_205755300
|
||||
#注册
|
||||
REGISTER: SMS_205755298
|
||||
#找回密码
|
||||
FIND_USER: SMS_205755301
|
||||
#设置密码
|
||||
UPDATE_PASSWORD: SMS_205755297
|
||||
#支付密码
|
||||
WALLET_PASSWORD: SMS_205755301
|
||||
system:
|
||||
isDemoSite: false
|
||||
statistics:
|
||||
|
@ -10,6 +10,7 @@ import cn.lili.common.sms.AliSmsUtil;
|
||||
import cn.lili.common.sms.SmsUtil;
|
||||
import cn.lili.common.utils.CommonUtil;
|
||||
import cn.lili.common.verification.enums.VerificationEnums;
|
||||
import cn.lili.config.properties.SmsTemplateSetting;
|
||||
import cn.lili.modules.connect.util.Base64Utils;
|
||||
import cn.lili.modules.member.entity.dos.Member;
|
||||
import cn.lili.modules.member.service.MemberService;
|
||||
@ -51,6 +52,9 @@ public class SmsUtilAliImplService implements SmsUtil, AliSmsUtil {
|
||||
@Autowired
|
||||
private MemberService memberService;
|
||||
|
||||
@Autowired
|
||||
private SmsTemplateSetting smsTemplateSetting;
|
||||
|
||||
@Override
|
||||
public void sendSmsCode(String mobile, VerificationEnums verificationEnums, String uuid) {
|
||||
//获取短信配置
|
||||
@ -75,17 +79,17 @@ public class SmsUtilAliImplService implements SmsUtil, AliSmsUtil {
|
||||
switch (verificationEnums) {
|
||||
//登录
|
||||
case LOGIN: {
|
||||
templateCode = "SMS_205755300";
|
||||
templateCode = smsTemplateSetting.getLOGIN();
|
||||
break;
|
||||
}
|
||||
//注册
|
||||
case REGISTER: {
|
||||
templateCode = "SMS_205755298";
|
||||
templateCode = smsTemplateSetting.getREGISTER();
|
||||
break;
|
||||
}
|
||||
//找回密码
|
||||
case FIND_USER: {
|
||||
templateCode = "SMS_205755301";
|
||||
templateCode = smsTemplateSetting.getFIND_USER();
|
||||
break;
|
||||
}
|
||||
//修改密码
|
||||
@ -96,7 +100,15 @@ public class SmsUtilAliImplService implements SmsUtil, AliSmsUtil {
|
||||
}
|
||||
//更新为用户最新手机号
|
||||
mobile = member.getMobile();
|
||||
templateCode = "SMS_205755297";
|
||||
templateCode = smsTemplateSetting.getUPDATE_PASSWORD();
|
||||
break;
|
||||
}
|
||||
//设置支付密码
|
||||
case WALLET_PASSWORD: {
|
||||
Member member = memberService.getById(UserContext.getCurrentUser().getId());
|
||||
//更新为用户最新手机号
|
||||
mobile = member.getMobile();
|
||||
templateCode = smsTemplateSetting.getWALLET_PASSWORD();
|
||||
break;
|
||||
}
|
||||
//如果不是有效的验证码手段,则此处不进行短信操作
|
||||
|
@ -0,0 +1,26 @@
|
||||
package cn.lili.config.properties;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* 短信模版设置
|
||||
*
|
||||
* @author Chopper
|
||||
*/
|
||||
@Data
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "lili.sms")
|
||||
public class SmsTemplateSetting {
|
||||
//登录
|
||||
private String LOGIN = "SMS_205755300";
|
||||
//注册
|
||||
private String REGISTER = "SMS_205755298";
|
||||
//找回密码
|
||||
private String FIND_USER = "SMS_205755301";
|
||||
//设置密码
|
||||
private String UPDATE_PASSWORD = "SMS_205755297";
|
||||
//设置支付密码
|
||||
private String WALLET_PASSWORD = "SMS_205755297";
|
||||
}
|
@ -6,7 +6,7 @@ import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 短信配置
|
||||
*
|
||||
* 这里在前台不做调整,方便客户直接把服务商的内容配置在我们平台
|
||||
* @author Chopper
|
||||
* @date 2020/11/30 15:23
|
||||
*/
|
||||
@ -17,7 +17,7 @@ public class SmsSetting implements Serializable {
|
||||
* 节点地址
|
||||
* key
|
||||
* 密钥
|
||||
* 签名,这里在前台不做调整,方便客户直接把服务商的内容配置在我们平台
|
||||
* 签名
|
||||
*/
|
||||
private String regionId;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user