From 70b1a417ba0dbeaca9298273d46dda64b4809f1c Mon Sep 17 00:00:00 2001 From: Zhou Zihao Date: Thu, 20 Jul 2023 16:28:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E4=BC=A0=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/TDesign/Components/TUpload.cs | 52 +++++++++++++++---------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/src/TDesign/Components/TUpload.cs b/src/TDesign/Components/TUpload.cs index c98d2381..8d57ec64 100644 --- a/src/TDesign/Components/TUpload.cs +++ b/src/TDesign/Components/TUpload.cs @@ -187,7 +187,7 @@ public async Task Upload(InputFileChangeEventArgs e) catch ( IOException ex ) { result.Status = Status.Default; - result.Tip = ex.Message; + result.Message = ex.Message; } finally { @@ -202,11 +202,14 @@ public async Task Upload(InputFileChangeEventArgs e) { using var readStream = await response.Content.ReadAsStreamAsync(); - var serverUploadResults = await JsonSerializer.DeserializeAsync>(readStream, new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); - - if(serverUploadResults is not null ) + if ( readStream is not null ) { - _results.AddRange(serverUploadResults); + var serverUploadResults = await JsonSerializer.DeserializeAsync>(readStream, new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); + + if ( serverUploadResults is not null ) + { + _results.AddRange(serverUploadResults); + } } } } @@ -232,22 +235,22 @@ public enum UploadTheme /// 输入框形式的文件上传风格。 /// [CssClass("single-file-input")]FileInput, - /// - /// 文件批量上传。 - /// - [CssClass("flow-file-flow")]FileFlow, - /// - /// 默认图片上传风格。 - /// - Image, - /// - /// 图片批量上传风格。 - /// - [CssClass("flow-image-flow")]ImageFlow, - /// - /// 完全自定义风格。 - /// - Custom, + ///// + ///// 文件批量上传。 + ///// + //[CssClass("flow-file-flow")]FileFlow, + ///// + ///// 默认图片上传风格。 + ///// + //Image, + ///// + ///// 图片批量上传风格。 + ///// + //[CssClass("flow-image-flow")]ImageFlow, + ///// + ///// 完全自定义风格。 + ///// + //Custom, } /// @@ -275,10 +278,5 @@ public class UploadResult /// /// 获取或设置上传后的提示 /// - public string? Tip { get; set; } - - /// - /// 获取 - /// - public Dictionary Data { get; set; } = new(); + public string? Message { get; set; } } \ No newline at end of file