From 7e54dcebba6a68d2408b79fe7b5e4f90d5e93c9a Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Tue, 15 Nov 2022 16:52:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BC=8F=E6=8F=90=E4=BA=86...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SysUserTokenServiceImpl.java | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) 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) {