|
|
@@ -7,6 +7,7 @@ import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
|
|
@@ -741,6 +742,18 @@ public class UserController {
|
|
|
@ApiOperation(value = "家长注册")
|
|
|
@XjrLog(value = "家长注册", saveResponseData = true)
|
|
|
public R register(@Valid @RequestBody RegisterDto dto) {
|
|
|
+ //验证家长手机号是否已经注册
|
|
|
+ LambdaQueryWrapper<User> userLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ userLambdaQueryWrapper
|
|
|
+ .eq(User::getMobile, dto.getMobile())
|
|
|
+ .eq(User::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
+ .last("limit 1")
|
|
|
+ ;
|
|
|
+ User user = userService.getOne(userLambdaQueryWrapper);
|
|
|
+ if(ObjectUtils.isNotEmpty(user)){
|
|
|
+ throw new MyException("当前手机号已被" + user.getName() + "使用,请更换手机号注册!");
|
|
|
+ }
|
|
|
+
|
|
|
// 验证验证码
|
|
|
if (!smsCtcc.captchaVerify(dto.getMobile(), dto.getSmsCode())) {
|
|
|
return R.error("验证码不正确!");
|