From 874287a4c02d0a980d8b97c4a691b4f37ec5e812 Mon Sep 17 00:00:00 2001
From: houzhongjian <houzhongyi@126.com>
Date: 星期二, 03 十二月 2024 08:47:04 +0800
Subject: [PATCH] 1、security模块ExpressionUrlAuthorizationConfigurer改为AuthorizeHttpRequestsConfigurer 2、全局registry.antMatchers改为registry.requestMatchers 3、增加积木报表

---
 iailab-module-report/iailab-module-report-biz/src/main/java/com/iailab/module/report/framework/jmreport/core/service/JmReportTokenServiceImpl.java |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/iailab-module-report/iailab-module-report-biz/src/main/java/com/iailab/module/report/framework/jmreport/core/service/JmReportTokenServiceImpl.java b/iailab-module-report/iailab-module-report-biz/src/main/java/com/iailab/module/report/framework/jmreport/core/service/JmReportTokenServiceImpl.java
index 878b9e4..deae3de 100644
--- a/iailab-module-report/iailab-module-report-biz/src/main/java/com/iailab/module/report/framework/jmreport/core/service/JmReportTokenServiceImpl.java
+++ b/iailab-module-report/iailab-module-report-biz/src/main/java/com/iailab/module/report/framework/jmreport/core/service/JmReportTokenServiceImpl.java
@@ -133,6 +133,13 @@
 
     @Override
     public String[] getRoles(String token) {
+        // 设置租户上下文。原因是:/jmreport/** 纯前端地址,不会走 buildLoginUserByToken 逻辑
+        LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
+        if (loginUser == null) {
+            return null;
+        }
+        TenantContextHolder.setTenantId(loginUser.getTenantId());
+
         // 参见文档 https://help.jeecg.com/jimureport/prodSafe.html 文档
         // 适配:如果是本系统的管理员,则转换成 jimu 报表的管理员
         Long userId = SecurityFrameworkUtils.getLoginUserId();

--
Gitblit v1.9.3