mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-29 05:09:46 +01:00
注册接口补上验证码判断
--LoginController.java
This commit is contained in:
parent
c660e192d8
commit
7cb0f0054f
1 changed files with 4 additions and 1 deletions
|
|
@ -67,7 +67,10 @@ public class LoginController {
|
||||||
@Operation(summary = "注册")
|
@Operation(summary = "注册")
|
||||||
public Result<Void> register(@RequestBody LoginDTO login) {
|
public Result<Void> register(@RequestBody LoginDTO login) {
|
||||||
// 验证是否正确输入验证码
|
// 验证是否正确输入验证码
|
||||||
captchaService.validate(login.getCaptchaId(), login.getCaptcha());
|
boolean validate = captchaService.validate(login.getCaptchaId(), login.getCaptcha());
|
||||||
|
if (!validate) {
|
||||||
|
throw new RenException("验证码错误,请重新获取");
|
||||||
|
}
|
||||||
// 按照用户名获取用户
|
// 按照用户名获取用户
|
||||||
SysUserDTO userDTO = sysUserService.getByUsername(login.getMobile());
|
SysUserDTO userDTO = sysUserService.getByUsername(login.getMobile());
|
||||||
if (userDTO != null){
|
if (userDTO != null){
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue