| | |
| | | package com.tcm.training.admin.app.auth.service; |
| | | |
| | | import com.tcm.training.admin.app.auth.config.AppAuthProperties; |
| | | import com.tcm.training.admin.app.auth.support.StpAppUserUtil; |
| | | import cn.dev33.satoken.stp.SaTokenInfo; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Service |
| | | public class AppAuthSessionService { |
| | | |
| | | private final AppAuthProperties appAuthProperties; |
| | | |
| | | public AppAuthSessionService(AppAuthProperties appAuthProperties) { |
| | | this.appAuthProperties = appAuthProperties; |
| | | } |
| | | |
| | | /** |
| | | * 为指定 APP 用户建立永久登录态。 |
| | | * 为指定 APP 用户建立登录态。 |
| | | */ |
| | | public void login(Long userId) { |
| | | StpAppUserUtil.login(userId); |
| | | StpAppUserUtil.login(userId, appAuthProperties.getTokenTimeoutSeconds()); |
| | | } |
| | | |
| | | /** |