فهرست منبع

OCR识别-营业执照接口修改

lcl 10 ماه پیش
والد
کامیت
c16178bcee
1فایلهای تغییر یافته به همراه11 افزوده شده و 7 حذف شده
  1. 11 7
      Areas/Api/Controllers/PubController.cs

+ 11 - 7
Areas/Api/Controllers/PubController.cs

@@ -27,16 +27,20 @@ namespace MySystem.Areas.Api.Controllers
         public JsonResult BusinessLicenseOcr(string value)
         {
             value = DesDecrypt(value);
-            Dictionary<string, object> Obj = BusinessLicenseOcrDo(value);
-            return Json(new AppResultJson() { Status = "1", Info = "", Data = Obj });
-        }
-        public Dictionary<string, object> BusinessLicenseOcrDo(string value)
-        {
             JsonData data = JsonMapper.ToObject(value);
             string Url = data["Url"].ToString();
+            if(string.IsNullOrEmpty(Url))
+            {
+                return Json(new AppResultJson() { Status = "-1", Info = "营业执照识别异常,请手动填写" });
+            }
+            string content = AliyunOcr.Check(Url);
+            if(string.IsNullOrEmpty(content))
+            {
+                return Json(new AppResultJson() { Status = "-1", Info = "营业执照识别异常,请手动填写" });
+            }
             Dictionary<string, object> Obj = new Dictionary<string, object>();
-            Obj.Add("OcrData", AliyunOcr.Check(Url));
-            return Obj;
+            Obj.Add("OcrData", content);
+            return Json(new AppResultJson() { Status = "1", Info = "", Data = Obj });
         }
         #endregion
     }