|
@@ -20,6 +20,7 @@ import org.springframework.stereotype.Component;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
import java.util.Random;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
@@ -141,6 +142,11 @@ public class SysLoginService {
|
|
|
//查询用户信息
|
|
|
loginUser = sysUserService.getAppUserInfo(username, tenantId, null);
|
|
|
|
|
|
+ if (Objects.isNull(loginUser)) {
|
|
|
+ recordLogininfor(username, Constants.LOGIN_FAIL, "用户不存在");
|
|
|
+ throw new BusinessException("用户不存在");
|
|
|
+ }
|
|
|
+
|
|
|
if (!SecurityUtils.matchesPassword(password, loginUser.getPassword())) {
|
|
|
recordLogininfor(username, Constants.LOGIN_FAIL, "用户密码错误");
|
|
|
throw new BusinessException("用户不存在/密码错误");
|