增加通用skills

This commit is contained in:
yubaolee
2026-05-24 20:04:35 +08:00
parent ad18885596
commit 92eda330e5
3 changed files with 31 additions and 58 deletions

View File

@@ -65,7 +65,8 @@ namespace Infrastructure.Middleware
// 启用倒带功能,就可以让 Request.Body 可以再次读取
request.EnableBuffering();
// 文件上传 记录文件信息
if (path.Contains("/upload"))
var contentType = request.ContentType?? "";
if (path.Contains("/upload") || contentType.Contains("multipart/form-data"))
{
var content = string.Join(",", request.Form.Files.Select(item => item.FileName));
logData.Add("request.body", $"收到上传文件:{content}");
@@ -73,7 +74,6 @@ namespace Infrastructure.Middleware
else
{
var sr = new StreamReader(request.Body, Encoding.UTF8);
//string content = sr.ReadToEnd(); //.Net Core 3.0 默认不再支持
var content = sr.ReadToEndAsync().Result;
logData.Add("request.body", content);
request.Body.Position = 0;