Browse Source

Merge branch 'feature/0124' of http://git.dayaedu.com/yonge/cooleshow into feature/0124

刘俊驰 1 year ago
parent
commit
49ec284579

+ 7 - 5
cooleshow-app/src/main/java/com/yonge/cooleshow/tenant/controller/open/OpenStudentController.java

@@ -115,17 +115,19 @@ public class OpenStudentController extends BaseController {
             student.setId(studentId);
         }
 
-        StudentWrapper.Student studentInfo = JSON.parseObject(JSON.toJSONString(student), StudentWrapper.Student.class);
-        studentInfo.setTenantId(tenantInfo.getId());
-
-        studentService.save(studentInfo);
-
         // 自动注册登陆验证码
         String loginCode = "";
         if (Optional.ofNullable(student.getLoginCode()).orElse(false)) {
             // 生成登陆验证码
             loginCode = sysMessageService.sendSecurityCode(MessageTypeEnum.SMS_VERIFY_CODE_LOGIN, student.getPhone());
         }
+
+        // 保存学生信息
+        StudentWrapper.Student studentInfo = JSON.parseObject(JSON.toJSONString(student), StudentWrapper.Student.class);
+        studentInfo.setTenantId(tenantInfo.getId());
+
+        studentService.save(studentInfo);
+
         return succeed(loginCode);
     }
 }