From f397e290416fcd2f7662ebab24432ce16e904460 Mon Sep 17 00:00:00 2001 From: liu liang Date: Thu, 10 Oct 2024 23:48:05 +0800 Subject: [PATCH] 8.1.12 --- CHANGELOG.md | 4 ++++ .../WorkFlow/ElsaTenantAccessor .cs | 12 +++++++++++- src/WalkingTec.Mvvm.Mvc/_WorkflowController.cs | 8 ++++++++ version.props | 2 +- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 147fe8a9d..042cbc9c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # 更新日志 ## v8.x.x + +##8.1.12(2024-10-10) +* **修改:** 修复Blazor和Vue下多租户工作流的Bug + ##8.1.10(2024-7-15) * **修改:** 修复Layui导出查询条件不变的bug * **修改:** 修复自带代码生成器Blazor生成代码大小写的问题 diff --git a/src/WalkingTec.Mvvm.Core/WorkFlow/ElsaTenantAccessor .cs b/src/WalkingTec.Mvvm.Core/WorkFlow/ElsaTenantAccessor .cs index 17ea04289..71ab8c607 100644 --- a/src/WalkingTec.Mvvm.Core/WorkFlow/ElsaTenantAccessor .cs +++ b/src/WalkingTec.Mvvm.Core/WorkFlow/ElsaTenantAccessor .cs @@ -24,7 +24,17 @@ public Task GetTenantIdAsync(CancellationToken cancellationToken = defau string t = null; var wtm = _hca.HttpContext.RequestServices.GetRequiredService(); - t = wtm?.LoginUserInfo?.CurrentTenant; + if (wtm?.LoginUserInfo != null) + { + t = wtm?.LoginUserInfo?.CurrentTenant; + } + else + { + if (_hca.HttpContext.Request.Cookies.ContainsKey("workflowtenant")) + { + t = _hca.HttpContext.Request.Cookies["workflowtenant"]; + } + } return Task.FromResult(t); } } diff --git a/src/WalkingTec.Mvvm.Mvc/_WorkflowController.cs b/src/WalkingTec.Mvvm.Mvc/_WorkflowController.cs index b0efbfbc6..df58a80a1 100644 --- a/src/WalkingTec.Mvvm.Mvc/_WorkflowController.cs +++ b/src/WalkingTec.Mvvm.Mvc/_WorkflowController.cs @@ -38,6 +38,14 @@ public IActionResult Inner() if (Wtm.LoginUserInfo.Roles.Any(x => x.RoleCode == "001") || Wtm.LoginUserInfo.Roles.Any(x => x.RoleName == "流程管理员")) { + if (Wtm.LoginUserInfo.TenantCode != null) + { + Response.Cookies.Append("workflowtenant", Wtm.LoginUserInfo.TenantCode); + } + else + { + Response.Cookies.Delete("workflowtenant"); + } return View(); } return Forbid(); diff --git a/version.props b/version.props index 4e6a589d8..ba5713edb 100644 --- a/version.props +++ b/version.props @@ -1,6 +1,6 @@ - 8.1.11 + 8.1.12