File tree Expand file tree Collapse file tree
src/BootstrapBlazor.Shared/Demos/BaiduOcr Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11@inject IBaiduOcr OcrService
2+ @inject ToastService ToastService
23
34<ButtonUpload TValue =" string" OnChange =" @OnClickToUpload" BrowserButtonText =" VATInvoice" ShowUploadFileList =" false" ></ButtonUpload >
45
9293 var payload = await file .GetBytesAsync (file .File .Size );
9394 if (payload ? .Any () ?? false )
9495 {
95- Invoice = await OcrService .CheckVatInvoiceAsync (payload );
96- StateHasChanged ();
96+ var result = await OcrService .CheckVatInvoiceAsync (payload );
97+ Invoice = result .Entity ;
98+ if (result .Entity != null )
99+ {
100+ await ToastService .Success (" Vat Invoice" , " VAT Invoice success!" );
101+ StateHasChanged ();
102+ }
103+ else
104+ {
105+ await ToastService .Information (" Vat Invoice" , $" {result .ErrorCode }: {result .ErrorMessage }" );
106+ }
97107 }
98108 }
99109 }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments