支持配置管理页面登录超时时间
This commit is contained in:
@@ -170,4 +170,9 @@ public class UserSetting {
|
||||
*/
|
||||
private int gbDeviceOnline = 1;
|
||||
|
||||
/**
|
||||
* 登录超时时间(分钟),
|
||||
*/
|
||||
private long loginTimeout = 30;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.genersoft.iot.vmp.conf.security;
|
||||
|
||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||
import com.genersoft.iot.vmp.conf.security.dto.JwtUser;
|
||||
import com.genersoft.iot.vmp.service.IUserApiKeyService;
|
||||
import com.genersoft.iot.vmp.service.IUserService;
|
||||
@@ -53,6 +54,8 @@ public class JwtUtils implements InitializingBean {
|
||||
private static IUserService userService;
|
||||
|
||||
private static IUserApiKeyService userApiKeyService;
|
||||
|
||||
private static UserSetting userSetting;
|
||||
|
||||
public static String getApiKeyHeader() {
|
||||
return API_KEY_HEADER;
|
||||
@@ -68,6 +71,11 @@ public class JwtUtils implements InitializingBean {
|
||||
JwtUtils.userApiKeyService = userApiKeyService;
|
||||
}
|
||||
|
||||
@Resource
|
||||
public void setUserSetting(UserSetting userSetting) {
|
||||
JwtUtils.userSetting = userSetting;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
try {
|
||||
@@ -153,7 +161,7 @@ public class JwtUtils implements InitializingBean {
|
||||
}
|
||||
|
||||
public static String createToken(String username) {
|
||||
return createToken(username, EXPIRATION_TIME);
|
||||
return createToken(username, userSetting.getLoginTimeout());
|
||||
}
|
||||
|
||||
public static String getHeader() {
|
||||
|
||||
Reference in New Issue
Block a user