人脸识别

This commit is contained in:
李超 2025-07-28 13:31:21 +08:00
parent 99115958e4
commit 5b8fc1f107
3 changed files with 7 additions and 12 deletions

View File

@ -106,12 +106,12 @@
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
dataType: "json", dataType: "json",
data: JSON.stringify({ data: JSON.stringify({
data: data, data: data
projectId:'<%=CurrUser.LoginProjectId%>'
}), }),
success: function (data) { success: function (data) {
/*window.parent.backData(data.d)*/ /*window.parent.backData(data.d)*/
alert(data.d)
if (data.d.indexOf('识别失败') !== -1) { if (data.d.indexOf('识别失败') !== -1) {
alert('识别失败请重新识别') alert('识别失败请重新识别')
} }

View File

@ -16,7 +16,7 @@ namespace FineUIPro.Web.WeldMat.UsingSentMat
} }
[WebMethod] [WebMethod]
public static string UploadData(string data,string projectId) public static string UploadData(string data)
{ {
byte[] imageBytes = Convert.FromBase64String(data.Substring("data:image/jpeg;base64,".Length)); byte[] imageBytes = Convert.FromBase64String(data.Substring("data:image/jpeg;base64,".Length));
string filePath = "/FileUpLoad/FaceRecognition/" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".jpeg"; string filePath = "/FileUpLoad/FaceRecognition/" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".jpeg";
@ -42,23 +42,18 @@ namespace FineUIPro.Web.WeldMat.UsingSentMat
var kqFace = (List<SgManager.AI.faceResult>)SgManager.AI.FaceClass.SearchFileFace(BLL.Funs.RootPath + filePath); var kqFace = (List<SgManager.AI.faceResult>)SgManager.AI.FaceClass.SearchFileFace(BLL.Funs.RootPath + filePath);
if (kqFace == null || kqFace.Count == 0) if (kqFace == null || kqFace.Count == 0)
{ {
return "识别失败"; return "识别失败";
} }
else if (kqFace[0].errMess != "SUCCESS") else if (kqFace[0].errMess != "SUCCESS")
{ {
return "识别失败;" + kqFace[0].errMess;
return "识别失败;" + kqFace[0].errMess;
} }
else else
{ {
try try
{ {
string idCard = kqFace[0].user_id; string idCard = kqFace[0].user_id;
var welder = Funs.DB.HJGL_BS_Welder.FirstOrDefault(x => x.ProjectId == projectId && x.IdentityCard == idCard); var welder = Funs.DB.HJGL_BS_Welder.FirstOrDefault(x =>x.IdentityCard == idCard);
if (welder != null) if (welder != null)
{ {
return welder.WED_Code; return welder.WED_Code;

View File

@ -98,7 +98,7 @@ namespace SgManager.AI
{ {
var image = url; var image = url;
var imageType = "URL"; var imageType = "URL";
var groupIdList = "WX_Face_TCC"; var groupIdList = "Face";
// 如果有可选参数 // 如果有可选参数
var options = new Dictionary<string, object>{ var options = new Dictionary<string, object>{
{"quality_control", "NORMAL"}, {"quality_control", "NORMAL"},