Merge remote-tracking branch 'origin/fix-bug-202303'

# Conflicts:
#	jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/CsrfFilter.java
#	jero-boot/jero-boot-single-startup/src/main/resources/application-dev.yml
This commit is contained in:
zer0Black
2023-05-30 10:30:17 +08:00
19 changed files with 835 additions and 628 deletions
@@ -172,8 +172,8 @@ public class JeroController<T, S extends IService<T>> {
// 获取上传文件对象
MultipartFile file = entity.getValue();
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
/*params.setTitleRows(2);
params.setHeadRows(1);*/
params.setNeedSave(true);
try {
List<T> list = ExcelImportUtil.importExcel(file.getInputStream(), clazz, params);
@@ -32,8 +32,8 @@ public class JwtUtil {
}
// Token过期时间24小时(用户登录过期时间是此时间的两倍,以token在reids缓存时间为准)
public static final long EXPIRE_TIME = 1440 * 60 * 1000L;
// Token过期时间30分钟(用户登录过期时间也是30分钟,以token在reids缓存时间为准)
public static final long EXPIRE_TIME = 30 * 60 * 1000L;
private static final String USERNAME_FIELD = "username";
@@ -79,6 +79,7 @@ public class JwtUtil {
* @return 加密的token
*/
public static String sign(String username, String secret) {
// 24小时后过期
Date date = new Date(System.currentTimeMillis() + EXPIRE_TIME);
Algorithm algorithm = Algorithm.HMAC256(secret);
// 附带username信息
@@ -158,7 +158,7 @@ public class ShiroRealm extends AuthorizingRealm {
String newAuthorization = JwtUtil.sign(userName, passWord);
// 设置超时时间
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, newAuthorization);
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME / 1000);
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME / 1000 * 2);
log.debug("——————————用户在线操作,更新token保证不掉线—————————jwtTokenRefresh——————— "+ token);
}
return true;
@@ -536,7 +536,7 @@ public class DbReadTableUtil {
}
//通过表名获取表备注
public String remarks(String a) throws SQLException, ClassNotFoundException {
public String remarks(String tableName) throws SQLException, ClassNotFoundException {
Connection connection = null;
Statement statement = null;
try {
@@ -544,7 +544,15 @@ public class DbReadTableUtil {
connection = DriverManager.getConnection(com.jero.codegenerate.properties.CodeConfigProperties.databaseUrl, com.jero.codegenerate.properties.CodeConfigProperties.username, com.jero.codegenerate.properties.CodeConfigProperties.password);
statement = connection.createStatement(1005, 1007);
String sqlStr = "SELECT table_comment FROM information_schema.TABLES WHERE table_name = " + "'"+a+"'";
String sqlStr = "";
if (com.jero.codegenerate.properties.CodeConfigProperties.databaseType.equals(DbConvertDef.MYSQL)) {
// mysql获取表的列信息sql
sqlStr = "SELECT table_comment FROM information_schema.TABLES WHERE table_name = " + "'"+tableName+"'";
}
// oracle获取表的列信息sql
if (com.jero.codegenerate.properties.CodeConfigProperties.databaseType.equals(DbConvertDef.ORACLE)) {
sqlStr = "SELECT comments FROM user_tab_comments WHERE table_name = '" + tableName.toUpperCase() + "'";
}
ResultSet resultSet = statement.executeQuery(sqlStr);
while(resultSet.next()) {
String name = resultSet.getString(1);