From e71dcccec6a1cf51c928a5143264cbbec105ff2f Mon Sep 17 00:00:00 2001 From: 移动系统liao <liaoxujun@qq.com> Date: 星期四, 22 八月 2024 08:35:21 +0800 Subject: [PATCH] 对接财富通 --- cylsg/EzUpFile/EzFileUploadService.cs | 39 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 38 insertions(+), 1 deletions(-) diff --git a/cylsg/EzUpFile/EzFileUploadService.cs b/cylsg/EzUpFile/EzFileUploadService.cs index e877b52..da61bfd 100644 --- a/cylsg/EzUpFile/EzFileUploadService.cs +++ b/cylsg/EzUpFile/EzFileUploadService.cs @@ -10,6 +10,8 @@ using Microsoft.AspNetCore.Http; using SqlSugar; +using System; +using System.Buffers.Text; using System.Drawing; using System.Globalization; using System.Security.Policy; @@ -339,6 +341,7 @@ idcordinfo = _tcs.IdCord(img64, PageName == "FRONT"); url = await UploadFilesFByBase64(_tcs.GetIdCordImg()); + idcordinfo.AdvancedInfo = null; return (idcordinfo, url); @@ -487,8 +490,42 @@ throw Oops.Oh(e.Message); } } +/// <inheritdoc/> - + public async Task<(bool, string)> IaiAddPerso(string imgBase64, string CoredID, string Name, int PersonGender) + { + if (string.IsNullOrEmpty(imgBase64)) + { + throw Oops.Oh("娌℃湁鍐呭"); + } + + //妫�鏌ヤ笂浼犲ぇ灏� + if (!CommonHelper.CheckBase64Size(imgBase64, 5)) + { + throw Oops.Oh("涓婁紶鏂囦欢澶у皬瓒呰繃闄愬埗锛屾渶澶у厑璁镐笂浼�" + "5" + "M"); + } + + imgBase64 = imgBase64.Replace("data:image/png;base64,", "").Replace("data:image/jgp;base64,", "").Replace("data:image/jpg;base64,", "").Replace("data:image/jpeg;base64,", "");//灏哹ase64澶撮儴淇℃伅鏇挎崲 + bool info = false; + string url = ""; + + try + { + info = _tcs.IaiAddPerso(imgBase64, CoredID, Name, PersonGender); + + url = await UploadFilesFByBase64(imgBase64); + + return (info, url); + + } + catch (Exception e) + { + + throw Oops.Oh(e.Message); + } + } + + #endregion } } -- Gitblit v1.9.1