fix: 修复progresstracker堆栈溢出的问题

This commit is contained in:
SikongJueluo 2025-08-08 16:34:31 +08:00
parent ae50ba3b9f
commit 58378851bb
No known key found for this signature in database
2 changed files with 4 additions and 3 deletions

View File

@ -11,6 +11,7 @@
<SpaRoot>../</SpaRoot>
<SpaProxyServerUrl>http://localhost:5173</SpaProxyServerUrl>
<SpaProxyLaunchCommand>npm run dev</SpaProxyLaunchCommand>
<NoWarn>CS1591</NoWarn>
</PropertyGroup>
<ItemGroup>
@ -24,7 +25,7 @@
<PackageReference Include="Microsoft.AspNetCore.SpaProxy" Version="9.0.4" />
<PackageReference Include="Microsoft.OpenApi" Version="1.6.23" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NLog" Version="5.4.0" />
<PackageReference Include="NLog" Version="5.4.0" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.4.0" />
<PackageReference Include="NSwag.AspNetCore" Version="14.3.0" />
<PackageReference Include="NSwag.CodeGeneration.TypeScript" Version="14.4.0" />

View File

@ -21,7 +21,7 @@ public class ProgressReporter : ProgressInfo, IProgress<int>
set
{
_stepProgress = value;
ExpectedSteps = MaxProgress / value;
_expectedSteps = MaxProgress / value;
}
}
public int ExpectedSteps
@ -31,7 +31,7 @@ public class ProgressReporter : ProgressInfo, IProgress<int>
{
_expectedSteps = value;
MaxProgress = Number.IntPow(10, Number.GetLength(value));
StepProgress = MaxProgress / value;
_stepProgress = MaxProgress / value;
}
}
public Func<int, Task>? ReporterFunc { get; set; } = null;