Fix/studio tenant header guid - #30
Merged
Merged
Conversation
Blazor WASM 下 Fetch 要求 Header 值为 Latin-1,中文租户名会导致请求失败。 改为持久化并发送 CurrentTenantId,UserMenu 下拉 value 使用租户 Id。 Co-authored-by: Cursor <cursoragent@cursor.com>
为 E2E 与本地验证提供 UseAbpTenantApi 场景下的 CJK 租户名; Studio 静态配置补充对应 DisplayName。 Co-authored-by: Cursor <cursoragent@cursor.com>
Host admin 切换「宝通」后断言无 Fetch Header 错误、__tenant 为 Guid、 identity/users/me 与工作流列表正常。 Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
分支类型
feature/*→ 目标分支:developrelease/*→ 目标分支:main(合并后需同步回 develop)hotfix/*→ 目标分支:main(合并后需同步回 develop)fix/studio-tenant-header-guid→ 目标分支:develop(Studio Blazor WASM 缺陷修复)变更说明
修复
BioTrace.Elsa.Abp.Studio.BlazorWasm在 Blazor WASM 下将中文等非 ASCII 租户名写入__tenantHTTP 头,导致浏览器fetch()抛出Failed to execute 'append' on 'Headers': String contains non ISO-8859-1 code point的问题。根因:
AbpTenantHeaderDelegatingHandler使用CurrentTenantName设置__tenant;浏览器 Fetch 规范要求 Header 值为 ISO-8859-1,CJK 字符会直接失败。实现:
Studio 包(
fix(studio))__tenant改为发送CurrentTenantId(GuidD格式),与 ABPHeaderTenantResolveContributor兼容IAbpStudioTenantContext:CurrentTenantId、CurrentTenantDisplayName;SetCurrentTenantAsync接受Guid?AbpStudioTenantContext以biotrace.elsa.studio.tenantId持久化 Id;启动时从旧 key(租户名)迁移UserMenu下拉Value改为tenant.Id,展示仍用DisplayNameAbpTenantHeaderDelegatingHandler单元测试演示 Host(
feat(host))DemoCjkTenantWorkflow,供 E2E 与本地复现E2E(
test(e2e))admin切换「宝通」后断言:无 Fetch Header 报错、__tenant为 Guid、identity/users/me与工作流列表正常破坏性变更:
IAbpStudioTenantContext.SetCurrentTenantAsync签名由string? tenantName改为Guid? tenantId。若有自定义实现需同步调整。关联
Relates to BioTrace.Nexus 侧报告的 Studio WASM 中文租户切换失败问题(
AbpTenantHeaderDelegatingHandler+UseAbpTenantApi: true)测试
dotnet build BioTrace.Elsa.Abp.slnxdotnet test BioTrace.Elsa.Abp.slnx(56 项通过,含新增 Handler 单测)npx playwright test tests/studio-tenancy.spec.ts -g "CJK"(CJK 租户切换 E2E 通过)发布说明(仅 release/hotfix 合并到 main 时填写)
不适用(目标分支为 develop)。下次 Studio 包发版时建议注明:
SetCurrentTenantAsync签名变更;__tenant现传 Guid 而非租户名。