feat: 兼容account占位符
All checks were successful
Build and Deploy / deploy (push) Successful in 1m10s

This commit is contained in:
xiaolipro 2026-09-15 18:09:57 +08:00
parent d90291dcd5
commit 946c9abaca

View File

@ -173,8 +173,20 @@ public class InterfaceForwardCommon(
foreach (var item in configs.Where(x => x.Flag == AuthParameterFlag.InParameter))
{
Debug.Assert(item.ParameterAlias != null, "item.ParameterAlias != null");
// 兼容account占位符
if (item.Value1 == GlobalConst.FromAccount)
{
body[item.ParameterAlias] =
accountFieldCache.FirstOrDefault(x =>
x.FieldName.Equals(item.ParameterAlias, StringComparison.OrdinalIgnoreCase))?.FieldValue ??
string.Empty;
}
else
{
body[item.ParameterAlias] = item.Value1;
}
}
// 构建授权上下文
interfaceDto.TargetInterface.FlowCode = interfaceDto.TargetInterface.FlowCode.IsNullOrWhiteSpace()
@ -208,7 +220,8 @@ public class InterfaceForwardCommon(
// 授权也走主流程
if (!cacheContext.TargetServiceProvider.AuthInterfaceCode.IsNullOrWhiteSpace())
{
Debug.Assert(cacheContext.ServiceProviderAuthInterface != null, "cacheContext.ServiceProviderAuthInterface != null");
Debug.Assert(cacheContext.ServiceProviderAuthInterface != null,
"cacheContext.ServiceProviderAuthInterface != null");
var flow = GetForwardFlow(cacheContext.ServiceProviderAuthInterface.TargetInterface.FlowCode!);
_flows.Add(cacheContext.ServiceProviderAuthInterface.TargetInterface.Code, flow);
}