/// <summary> /// /// </summary> /// <param name="args"></param> /// <returns></returns> protected override async Task OnFileChange(InputFileChangeEventArgs args) { CurrentFile = new UploadFile() { OriginFileName = args.File.Name, Size = args.File.Size, File = args.File, Uploaded = false }; CurrentFile.ValidateId = $"{Id}_{CurrentFile.GetHashCode()}"; if (IsSingle) { // 单图片模式 DefaultFileList?.Clear(); UploadFiles.Clear(); } UploadFiles.Add(CurrentFile); await base.OnFileChange(args); // ValidateFile 后 IsValid 才有值 CurrentFile.IsValid = IsValid; if (OnChange != null) { await OnChange(CurrentFile); } else { await CurrentFile.RequestBase64ImageFileAsync(CurrentFile.File.ContentType, 320, 240); } }