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:
+2
-2
@@ -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);
|
||||
|
||||
+3
-2
@@ -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信息
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user