Browse Source

初始密码

chao 4 years ago
parent
commit
74e7a55730

+ 5 - 5
src/main/java/com/caimei365/user/service/impl/RegisterServiceImpl.java

@@ -511,7 +511,8 @@ public class RegisterServiceImpl implements RegisterService {
         // 设置机构上线
         user.setClubStatus(90);
         // 默认密码
-        String initPassword = CodeUtil.generateCodeInt(8);
+        String randomCode = CodeUtil.generateCodeInt(6);
+        String initPassword = "cm" + randomCode;
         user.setPassword(Md5Util.md5(initPassword));
         // 同意协议
         user.setAgreeFlag(isAgreed);
@@ -619,20 +620,19 @@ public class RegisterServiceImpl implements RegisterService {
          * 协销去后台审核,机构用账号密码登录绑定微信
          */
         String logTxt = "【协销拉机构上线】短信内容:>>>欢迎成为采美 %s 用户,您的登录账号为:%s,初始密码为:%s";
-        int smsType = 7;
+        int smsType = 6;
         if (StringUtils.isNotBlank(email)) {
             // 会员机构
             logTxt = String.format(logTxt, "会员机构", mobile, initPassword);
-            smsType = 6;
         } else {
             // 普通机构
             logTxt = String.format(logTxt, "普通机构", mobile, initPassword);
         }
         // 发送短信
-        boolean smsFlag = AliyunSmsUtil.sendSms(mobile, smsType, "{name:"+ mobile +",password:"+ initPassword +"}");
+        boolean smsFlag = AliyunSmsUtil.sendSms(mobile, 6, "{name:"+ mobile +",content:"+ randomCode +"}");
         if (!smsFlag) {
             // 短信发送失败重试一次
-            AliyunSmsUtil.sendSms(mobile, smsType, "{name:"+ mobile +",password:"+ initPassword +"}");
+            AliyunSmsUtil.sendSms(mobile, 6, "{name:"+ mobile +",content:"+ randomCode +"}");
         }
         // 打印短信内容
         log.info(logTxt);

+ 8 - 5
src/main/java/com/caimei365/user/utils/AliyunSmsUtil.java

@@ -51,11 +51,14 @@ public class AliyunSmsUtil {
             // 模版内容: 验证码${code},您正在进行身份验证,打死不要告诉别人哦!
             templateCode = "SMS_205240544";
         } else if (type == 6) {
-            // 模版内容: 欢迎成为采美会员机构用户,您的登录账号为:${name},初始密码为:${password}。
-            templateCode = "SMS_205430877";
-        } else if (type == 7) {
-            // 模版内容: 欢迎成为采美普通机构用户,您的登录账号为:${name},初始密码为:${password},您可使用该账号密码登录采美365网和“采美采购商城”小程序。
-            templateCode = "SMS_205440777";
+//             模版内容: 欢迎成为采美会员机构用户,您的登录账号为:${name},初始密码为:${password}。
+//            templateCode = "SMS_205430877";
+
+            // 模版内容: 欢迎成为采美机构用户,您的登录账号为:${name},初始密码为:cm${content},您可使用该账号密码登录采美365网和“采美采购商城”小程序。
+            templateCode = "SMS_215122672";
+//        } else if (type == 7) {
+//            // 模版内容: 欢迎成为采美普通机构用户,您的登录账号为:${name},初始密码为:${password},您可使用该账号密码登录采美365网和“采美采购商城”小程序。
+//            templateCode = "SMS_205440777";
         } else if (type == 8) {
             // 模版内容: 欢迎注册采美365网,您的短信验证码为:${code},该验证码 5 分钟内有效,请勿泄漏于他人。
             templateCode = "SMS_205435882";

+ 2 - 2
src/test/java/com/caimei365/user/UserApplicationTests.java

@@ -18,8 +18,8 @@ class UserApplicationTests {
 //    @Test
 //    void sms(){
 //        String mobile = "15814011616";
-//        String randomCode = CodeUtil.generateCodeInt(8);
-//        AliyunSmsUtil.sendSms(mobile, 7, "{name:"+ mobile +",password:"+ randomCode +"}");
+//        String randomCode = CodeUtil.generateCodeInt(6);
+//        AliyunSmsUtil.sendSms(mobile, 6, "{name:"+ mobile +",content:"+ randomCode +"}");
 //    }