feat: 去除登录验证码限制
This commit is contained in:
+13
-14
@@ -83,17 +83,19 @@ public class LoginServiceImpl implements ILoginService {
|
|||||||
return Results.error(CommonConstant.SC_RSA_TIMEOUT_600, "页面过期,将刷新页面");
|
return Results.error(CommonConstant.SC_RSA_TIMEOUT_600, "页面过期,将刷新页面");
|
||||||
}
|
}
|
||||||
|
|
||||||
String captcha = sysLoginModel.getCaptcha();
|
// String captcha = sysLoginModel.getCaptcha();
|
||||||
if(captcha==null){
|
// if(captcha==null){
|
||||||
return Results.error("验证码无效");
|
// return Results.error("验证码无效");
|
||||||
}
|
// }
|
||||||
String lowerCaseCaptcha = captcha.toLowerCase();
|
// String lowerCaseCaptcha = captcha.toLowerCase();
|
||||||
String realKey = MD5Util.MD5Encode(lowerCaseCaptcha + sysLoginModel.getCheckKey(), UTF_8);
|
// String realKey = MD5Util.MD5Encode(lowerCaseCaptcha + sysLoginModel.getCheckKey(), UTF_8);
|
||||||
Object checkCode = redisUtil.get(realKey);
|
// Object checkCode = redisUtil.get(realKey);
|
||||||
// 验证码前后端比较
|
// // 验证码前后端比较
|
||||||
if(checkCode == null || !checkCode.toString().equals(lowerCaseCaptcha)) {
|
// if(checkCode == null || !checkCode.toString().equals(lowerCaseCaptcha)) {
|
||||||
return Results.error("验证码错误");
|
// return Results.error("验证码错误");
|
||||||
}
|
// }
|
||||||
|
// redisUtil.del(realKey);
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//解密获取密码和用户名
|
//解密获取密码和用户名
|
||||||
@@ -140,9 +142,6 @@ public class LoginServiceImpl implements ILoginService {
|
|||||||
|
|
||||||
//用户登录信息
|
//用户登录信息
|
||||||
userInfo(sysUser, result);
|
userInfo(sysUser, result);
|
||||||
//update-begin--Author:liusq Date:20210126 for:登录成功,删除redis中的验证码
|
|
||||||
redisUtil.del(realKey);
|
|
||||||
//update-begin--Author:liusq Date:20210126 for:登录成功,删除redis中的验证码
|
|
||||||
//update-begin--Author:wangshuai Date:20200714 for:登录日志没有记录人员
|
//update-begin--Author:wangshuai Date:20200714 for:登录日志没有记录人员
|
||||||
LoginUser loginUser = new LoginUser();
|
LoginUser loginUser = new LoginUser();
|
||||||
BeanUtils.copyProperties(sysUser, loginUser);
|
BeanUtils.copyProperties(sysUser, loginUser);
|
||||||
|
|||||||
@@ -19,5 +19,17 @@
|
|||||||
<groupId>com.jero.boot</groupId>
|
<groupId>com.jero.boot</groupId>
|
||||||
<artifactId>jero-system-local-api</artifactId>
|
<artifactId>jero-system-local-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.javafaker</groupId>
|
||||||
|
<artifactId>javafaker</artifactId>
|
||||||
|
<version>1.0.2</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.yaml</groupId>
|
||||||
|
<artifactId>snakeyaml</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
+11
@@ -9,9 +9,12 @@ import com.jero.common.exception.JeroBootException;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import com.github.javafaker.Faker;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.jero.common.system.query.QueryGenerator;
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
|
||||||
@@ -25,6 +28,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
@Transactional(rollbackFor = JeroBootException.class)
|
@Transactional(rollbackFor = JeroBootException.class)
|
||||||
public class KhOilRealtimeDataServiceImpl extends ServiceImpl<KhOilRealtimeDataMapper, KhOilRealtimeData> implements IKhOilRealtimeDataService {
|
public class KhOilRealtimeDataServiceImpl extends ServiceImpl<KhOilRealtimeDataMapper, KhOilRealtimeData> implements IKhOilRealtimeDataService {
|
||||||
|
|
||||||
|
private final Faker faker = new Faker();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 列表查询
|
||||||
@@ -67,6 +71,13 @@ public class KhOilRealtimeDataServiceImpl extends ServiceImpl<KhOilRealtimeDataM
|
|||||||
public Map<String, Object> realtimeDataResults(String id) {
|
public Map<String, Object> realtimeDataResults(String id) {
|
||||||
KhOilRealtimeData khOilRealtimeData = new KhOilRealtimeData();
|
KhOilRealtimeData khOilRealtimeData = new KhOilRealtimeData();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private double getRandomDouble() {
|
||||||
|
// 生成一个在0到100之间,小数点后有2位的随机浮点数
|
||||||
|
return faker.number().randomDouble(2, 0, 100);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -191,6 +191,18 @@
|
|||||||
<version>${commons-beanutils.version}</version>
|
<version>${commons-beanutils.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.javafaker</groupId>
|
||||||
|
<artifactId>javafaker</artifactId>
|
||||||
|
<version>1.0.2</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.yaml</groupId>
|
||||||
|
<artifactId>snakeyaml</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-fileupload</groupId>
|
<groupId>commons-fileupload</groupId>
|
||||||
<artifactId>commons-fileupload</artifactId>
|
<artifactId>commons-fileupload</artifactId>
|
||||||
|
|||||||
Reference in New Issue
Block a user