init
This commit is contained in:
@@ -13,6 +13,7 @@ import com.ruoyi.common.enums.DeviceType;
|
||||
import com.ruoyi.common.enums.UserType;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 登录鉴权助手
|
||||
@@ -26,6 +27,7 @@ import lombok.NoArgsConstructor;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Slf4j
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class LoginHelper {
|
||||
|
||||
@@ -67,6 +69,14 @@ public class LoginHelper {
|
||||
StpUtil.getTokenSession().set(LOGIN_USER_KEY, loginUser);
|
||||
}
|
||||
|
||||
public static void logoutApp(Long userId){
|
||||
try {
|
||||
StpUtil.logout(UserType.APP_USER.getUserType() + ":" + userId);
|
||||
}catch (Exception e){
|
||||
log.error("强制T人下线失败! userId={}",userId,e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户(多级缓存)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user