|
@@ -80,8 +80,7 @@ public class OpenStudentController extends BaseController {
|
|
|
if (StringUtils.isEmpty(code)) {
|
|
|
throw new BizException("验证码不能为空");
|
|
|
}
|
|
|
- if (!smsCodeService.verifyValidCode(student.getPhone(), code,
|
|
|
- MessageTypeEnum.SMS_VERIFY_CODE_REGISTER.getCode())) {
|
|
|
+ if (!smsCodeService.verifyValidCode(student.getPhone(), code, "REGISTER")) {
|
|
|
throw new BizException("验证码错误");
|
|
|
}
|
|
|
Long tenantId = student.getTenantId();
|
|
@@ -109,10 +108,10 @@ public class OpenStudentController extends BaseController {
|
|
|
if (one.getTenantId().equals(-1L)) {
|
|
|
throw new BizException("该手机号已经注册为平台学生");
|
|
|
}
|
|
|
-// if (one.getTenantId().equals(tenantId)) {
|
|
|
-// //已经注册当前机构,请勿重复注册
|
|
|
-// throw new BizException(5004, tenantInfo.getName());
|
|
|
-// }
|
|
|
+ if (one.getTenantId().equals(tenantId)) {
|
|
|
+ //已经注册当前机构,请勿重复注册
|
|
|
+ throw new BizException("已经注册当前机构,请勿重复注册");
|
|
|
+ }
|
|
|
// 转到其他机构
|
|
|
if ((!Objects.equals(student.getTenantId(), one.getTenantId()))) {
|
|
|
if(student.getUpdateTenant() == null || Boolean.FALSE.equals(student.getUpdateTenant())){
|
|
@@ -134,6 +133,8 @@ public class OpenStudentController extends BaseController {
|
|
|
log.error("学生注册,切换机构退群失败:{}", e.getMessage());
|
|
|
}
|
|
|
});
|
|
|
+ // 删除好友
|
|
|
+ imUserFriendService.delFriendByTenantId(tenantId, one.getUserId());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -145,17 +146,6 @@ public class OpenStudentController extends BaseController {
|
|
|
student.setId(studentId);
|
|
|
}
|
|
|
|
|
|
- // 配置头像
|
|
|
- String avatar = student.getAvatar();
|
|
|
- if (StringUtils.isEmpty(avatar)) {
|
|
|
- if (student.getGender().equals(1)) {
|
|
|
- avatar = sysConfigService.findConfigValue(SysConfigConstant.DEFAULT_HEARD_BOY);
|
|
|
- } else {
|
|
|
- avatar = sysConfigService.findConfigValue(SysConfigConstant.DEFAULT_HEARD_GIRL);
|
|
|
- }
|
|
|
- student.setAvatar(avatar);
|
|
|
- }
|
|
|
-
|
|
|
StudentWrapper.Student studentInfo = JSON.parseObject(JSON.toJSONString(student), StudentWrapper.Student.class);
|
|
|
studentInfo.setTenantId(tenantInfo.getId());
|
|
|
|