Commit db7f9b02 authored by 施翔轲's avatar 施翔轲

优化新增租户时自动生成密码为八位数,大小写英文加数字

parent 4398f203
......@@ -228,7 +228,11 @@ public class ISysTenantServiceImpl implements ISysTenantService {
//租户新增成功,发送短信通知租户
//此处暂用钉钉机器人模拟发送短信
String content = "【央企数字经营管理系统通知】:" + bo.getCompanyName() + "您好,您已经成功注册央企数字经营管理系统,请使用手机号码登录,初始密码为" + password + "。友情提示:为了您的账号安全,请勿泄露密码。若需要修改密码,请联系管理员。";
String content = "【央企数字经营管理系统通知】:"
+ bo.getCompanyName()
+ "您好,您已经成功注册央企数字经营管理系统,请使用手机号码登录,初始密码为"
+ password
+ "。友情提示:为了您的账号安全,请勿泄露密码。若需要修改密码,请联系管理员。";
DingTalkUtil.sendDingTalkMsg(content);
System.out.println("👉🏻:" + content);
return true;
......@@ -236,7 +240,7 @@ public class ISysTenantServiceImpl implements ISysTenantService {
// 生成随机密码
public static String generatePassword(int length) {
String characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*_+=";
String characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
StringBuilder password = new StringBuilder();
Random random = new Random();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment