From e0cd5381e248fcfa840dee56d54a2bd2357ce91a Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期三, 03 八月 2022 16:48:55 +0800
Subject: [PATCH] 数据逻辑删除不进行唯一验证
---
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java
index 5776c52..08157b6 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java
@@ -23,6 +23,7 @@
import com.ruoyi.common.utils.ip.IpUtils;
import com.ruoyi.framework.manager.AsyncManager;
import com.ruoyi.framework.manager.factory.AsyncFactory;
+import com.ruoyi.framework.security.context.AuthenticationContextHolder;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysUserService;
@@ -60,9 +61,9 @@
*/
public String login(String username, String password, String code, String uuid)
{
- boolean captchaOnOff = configService.selectCaptchaOnOff();
+ boolean captchaEnabled = configService.selectCaptchaEnabled();
// 验证码开关
- if (captchaOnOff)
+ if (captchaEnabled)
{
validateCaptcha(username, code, uuid);
}
@@ -70,9 +71,10 @@
Authentication authentication = null;
try
{
+ UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password);
+ AuthenticationContextHolder.setContext(authenticationToken);
// 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
- authentication = authenticationManager
- .authenticate(new UsernamePasswordAuthenticationToken(username, password));
+ authentication = authenticationManager.authenticate(authenticationToken);
}
catch (Exception e)
{
--
Gitblit v1.9.2