diff --git a/renren-admin/src/main/java/io/renren/modules/security/service/impl/SysUserTokenServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/security/service/impl/SysUserTokenServiceImpl.java index afc3307b..5b2460e3 100644 --- a/renren-admin/src/main/java/io/renren/modules/security/service/impl/SysUserTokenServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/security/service/impl/SysUserTokenServiceImpl.java @@ -12,6 +12,7 @@ import io.renren.modules.security.entity.SysUserTokenEntity; import io.renren.modules.security.oauth2.TokenGenerator; import io.renren.modules.security.service.SysUserTokenService; import io.renren.modules.sys.entity.SysOnlineEntity; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.util.Date; @@ -21,11 +22,17 @@ import java.util.Map; @Service public class SysUserTokenServiceImpl extends BaseServiceImpl implements SysUserTokenService { + + /** * 12小时后过期 */ private final static int EXPIRE = 3600 * 12; + @Value("${system.allowSimultaneousLogin}") + private int allowSimultaneousLogin; + + /* @Override public Result createToken(Long userId) { //用户token @@ -81,6 +88,56 @@ public class SysUserTokenServiceImpl extends BaseServiceImpl map = new HashMap<>(2); + map.put(Constant.TOKEN_HEADER, token); + map.put("expire", EXPIRE); + return new Result().ok(map); + } + @Override public void logout(Long userId) {