2024年08月02日 1.0.9 token时长读取配置文件tokenOutTime

main
gaoshuguang 1 year ago
parent f8748a68bd
commit 92507f4e99

@ -5,6 +5,7 @@ import com.auth0.jwt.JWTVerifier;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.interfaces.DecodedJWT;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
@ -25,13 +26,13 @@ public class TokenUtil {
static {
String SystemType = PropertiesUtil.getValue("SystemType");
if (SystemType == null || SystemType.equals("0") || SystemType.equals("2")) {
if (StringUtils.isEmpty(SystemType) || SystemType.equals("0") || SystemType.equals("2")) {
TOKEN_SECRET = "apiManager";
} else if (SystemType.equals("1")) {
TOKEN_SECRET = "5267915";
}
String tokenOutTime = PropertiesUtil.getValue("tokenOutTime");
if (tokenOutTime.isEmpty()) {
if (StringUtils.isEmpty(tokenOutTime)) {
tokenOutTime = "30";
}
EXPIRE_DATE = Long.parseLong(tokenOutTime) * 60 * 1000;

Loading…
Cancel
Save