perf:登录的时候清除授权信息,相当于刷新一下权限
This commit is contained in:
@@ -11,7 +11,9 @@ import com.tiesheng.login.pojos.dao.CorePlatformUnique;
|
||||
import com.tiesheng.util.ServletKit;
|
||||
import com.tiesheng.util.config.Ip2regionConfig;
|
||||
import com.tiesheng.util.pojos.TokenBean;
|
||||
import com.tiesheng.util.service.TsCacheService;
|
||||
import com.tiesheng.util.service.TsServiceBase;
|
||||
import com.tiesheng.util.service.role.TsAuthorityHandler;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -51,6 +53,10 @@ public class CorePlatformUniqueService extends TsServiceBase<CorePlatformUniqueM
|
||||
TokenBean tokenBean = tsLoginConfigurer.login(platformUnique);
|
||||
if (tokenBean != null) {
|
||||
|
||||
// 清除授权信息
|
||||
TsCacheService.of().remove(StrUtil.format(TsAuthorityHandler.CACHE_HAS_AUTHORITY,
|
||||
tokenBean.getRoleId(), tokenBean.getId()));
|
||||
|
||||
// 添加登录日志
|
||||
addLoginLog(platformUnique, tokenBean);
|
||||
|
||||
@@ -61,7 +67,6 @@ public class CorePlatformUniqueService extends TsServiceBase<CorePlatformUniqueM
|
||||
saveOrUpdate(platformUnique);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return tokenBean;
|
||||
|
||||
Reference in New Issue
Block a user