File tree Expand file tree Collapse file tree
src/Extensions/Components/BootstrapBlazor.BaiduOcr Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk.Razor" >
22
33 <PropertyGroup >
4- <Version >7.0.1 </Version >
4+ <Version >7.0.2 </Version >
55 </PropertyGroup >
66
77 <PropertyGroup >
Original file line number Diff line number Diff line change @@ -32,17 +32,17 @@ public void Scan(byte[] image)
3232 /// <summary>
3333 /// 识别增值税发票方法
3434 /// </summary>
35- public Task < string > CheckVatInvoiceJsonAsync ( byte [ ] image ) => Task . Run ( ( ) =>
35+ public Task < string > CheckVatInvoiceJsonAsync ( byte [ ] image , CancellationToken token = default ) => Task . Run ( ( ) =>
3636 {
3737 var client = new Ocr ( Options . CurrentValue . ApiKey , Options . CurrentValue . Secret ) ;
3838 var resp = client . VatInvoice ( image ) ;
3939 return resp . ToString ( ) ;
40- } ) ;
40+ } , token ) ;
4141
4242 /// <summary>
4343 /// 识别增值税发票方法
4444 /// </summary>
45- public Task < BaiduOcrResult < InvoiceEntity > > CheckVatInvoiceAsync ( byte [ ] image ) => Task . Run ( ( ) =>
45+ public Task < BaiduOcrResult < InvoiceEntity > > CheckVatInvoiceAsync ( byte [ ] image , CancellationToken token = default ) => Task . Run ( ( ) =>
4646 {
4747 var ret = new BaiduOcrResult < InvoiceEntity > ( ) ;
4848 var client = new Ocr ( Options . CurrentValue . ApiKey , Options . CurrentValue . Secret ) ;
@@ -57,5 +57,5 @@ public Task<BaiduOcrResult<InvoiceEntity>> CheckVatInvoiceAsync(byte[] image) =>
5757 ret . ErrorMessage = resp . Value < string > ( "error_msg" ) ;
5858 }
5959 return ret ;
60- } ) ;
60+ } , token ) ;
6161}
Original file line number Diff line number Diff line change @@ -13,12 +13,14 @@ public interface IBaiduOcr
1313 /// 增值税发票识别
1414 /// </summary>
1515 /// <param name="image"></param>
16- Task < BaiduOcrResult < InvoiceEntity > > CheckVatInvoiceAsync ( byte [ ] image ) ;
16+ /// <param name="token"></param>
17+ Task < BaiduOcrResult < InvoiceEntity > > CheckVatInvoiceAsync ( byte [ ] image , CancellationToken token = default ) ;
1718
1819 /// <summary>
1920 /// 增值税发票识别
2021 /// </summary>
2122 /// <param name="image"></param>
23+ /// <param name="token"></param>
2224 /// <returns></returns>
23- Task < string > CheckVatInvoiceJsonAsync ( byte [ ] image ) ;
25+ Task < string > CheckVatInvoiceJsonAsync ( byte [ ] image , CancellationToken token = default ) ;
2426}
You can’t perform that action at this time.
0 commit comments