From 484d931fd6d4174b91caedf9fcea7f060a15facb Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 6 May 2021 15:43:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=9D=E5=A7=8B=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E5=92=8C=E7=99=BB=E5=BD=95=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=9C=A8dataease.properties=E9=87=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/java/io/dataease/auth/util/JWTUtils.java | 6 ++++-- backend/src/main/resources/application.properties | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/io/dataease/auth/util/JWTUtils.java b/backend/src/main/java/io/dataease/auth/util/JWTUtils.java index 8dbed6faf2..452c38812b 100644 --- a/backend/src/main/java/io/dataease/auth/util/JWTUtils.java +++ b/backend/src/main/java/io/dataease/auth/util/JWTUtils.java @@ -85,8 +85,10 @@ public class JWTUtils { public static boolean loginExpire(String token){ if (Login_Interval==0) { String property = CommonBeanFactory.getBean(Environment.class).getProperty("dataease.login_timeout"); - int seconds = StringUtils.isNotEmpty(property) ? Integer.parseInt(property): (10*60); - Login_Interval = seconds * 1000; + // 默认超时时间是8h + int minute = StringUtils.isNotEmpty(property) ? Integer.parseInt(property): (8*60); + // 分钟换算成毫秒 + Login_Interval = minute * 1000 * 60; } Long now = System.currentTimeMillis(); Long lastOperateTime = tokenLastOperateTime(token); diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 69f15f7e2a..0f07e87ea1 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -62,10 +62,12 @@ spring.mvc.log-request-details=true pagehelper.PageRowBounds=true #excel等用户上传文件路径 upload.file.path=/opt/dataease/data/upload/ + +#初始密码和登录超时时间移到/opt/dataease/conf/dataease.properties #用户初始密码,如果不设置默认是DataEase123.. -dataease.init_password=DataEase123456 -#登录超时时间单位s 设置默认30分钟 如果雨不设置 默认10分钟也就是10*60 -dataease.login_timeout=1800 +#dataease.init_password=DataEase123456 +#登录超时时间单位min +#dataease.login_timeout=480