短信功能调整

This commit is contained in:
2023-08-09 12:42:24 +08:00
parent 4de091dae7
commit e388a06937
2 changed files with 3 additions and 4 deletions

View File

@@ -200,7 +200,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, User> impleme
appInfoSet.setSystemInfo(1);
appInfoSet.setHarmonicInfo(1);
appInfoSetService.save(appInfoSet);
//发送密码短信
//发送用户初始密码
sendPasswordMessage(phone,newUser.getId());
}
}
@@ -352,7 +352,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, User> impleme
//必填:短信模板-可在短信控制台中找到,发送国际/港澳台消息时,请使用国际/港澳台短信模版
request.setTemplateCode(msgTemplate);
String password = redisUtil.getStringByKey(userId);
String code = "{\"code\":\"" + password + "\"}";
String code = "{\"pwd\":\"" + password + "\"}";
request.setTemplateParam(code);
//请求失败这里会抛ClientException异常
SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request);

View File

@@ -96,8 +96,7 @@ public class UserSetServiceImpl extends ServiceImpl<UserSetMapper, UserSet> impl
Sm4Utils sm4 = new Sm4Utils(secretKey);
//随机生成8位密码
String password = PubUtils.getCode(8);
System.out.println("password===:" + password);
redisUtil.saveByKeyWithExpire(userId,password,10L);
redisUtil.saveByKey(userId,password);
//SM4加密初始默认密码
String strSm4 = sm4.encryptData_ECB(password);
userSet.setStandBy(strSm4);