| | |
| | | import com.ruoyi.im.service.ImApiServcie; |
| | | import com.ruoyi.im.dto.RegisterDto; |
| | | import com.ruoyi.im.util.SymmetricCryptoUtil; |
| | | import com.ruoyi.im.util.ValidatorUtil; |
| | | import com.ruoyi.system.domain.GroupWelcomeConfig; |
| | | import com.ruoyi.system.domain.IpBlacklist; |
| | | import com.ruoyi.system.domain.UserAccount; |
| | |
| | | @PostMapping("/register") |
| | | public Result register(@Validated RegisterDto dto){ |
| | | try { |
| | | // 验证手机号 |
| | | boolean isPhoneValid = ValidatorUtil.isValidPhone(dto.getAccount()); |
| | | if(!isPhoneValid){ |
| | | return Result.error("手机号格式不正确"); |
| | | } |
| | | return imApiServcie.register(dto); |
| | | } catch (RuntimeException e) { |
| | | // 从异常消息中解析Result对象 |