wanshenmean
2026-03-13 a2b55742c64f4b2c9e6bd85ed3733adccdec48de
分支
用户 wanshenmean <cathay_xy@163.com>
星期五, 三月 13, 2026 14:37 +0800
提交者 wanshenmean <cathay_xy@163.com>
星期五, 三月 13, 2026 14:37 +0800
提交a2b55742c64f4b2c9e6bd85ed3733adccdec48de
目录 8f48a6142400726aad4b8f5e027e79c014859f33 目录 | zip | gz
上一版本 58376d519aeb76ef78d38b737c0c57f8d982fb52 查看 | 对比
fix: 修复Web页面HttpClient依赖注入问题

- 在Program.cs中注册HttpClient服务
- 将HttpClient注入改为IHttpClientFactory注入
- 在每个方法中动态创建HttpClient并设置BaseAddress
- 修复Create/Edit/Details页面的依赖注入问题

修复了创建实例页面报错:
InvalidOperationException: Unable to resolve service for type
'System.Net.Http.IHttpClientFactory'

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
已修改4个文件
47 ■■■■■ 文件已修改
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Web/Pages/Create.cshtml.cs 11 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Web/Pages/Details.cshtml.cs 12 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Web/Pages/Edit.cshtml.cs 23 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Web/Program.cs 1 ●●●● 对比 | 查看 | 原始文档 | blame | 历史