|
@@ -27,16 +27,20 @@ namespace MySystem.Areas.Api.Controllers
|
|
|
public JsonResult BusinessLicenseOcr(string value)
|
|
public JsonResult BusinessLicenseOcr(string value)
|
|
|
{
|
|
{
|
|
|
value = DesDecrypt(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);
|
|
JsonData data = JsonMapper.ToObject(value);
|
|
|
string Url = data["Url"].ToString();
|
|
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>();
|
|
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
|
|
#endregion
|
|
|
}
|
|
}
|