|
@@ -579,7 +579,7 @@ func (this *CompanyUserController) AddUser() {
|
|
|
//如果百度未识别出来手机号或者公司名称,那么进行阿里识别
|
|
|
if !isFlag || (len(companyNameSlice) == 0 && crmConfig.ConfigValue == "true") {
|
|
|
//阿里云识别
|
|
|
- aliyunResult, err := services.AliyunOcrBusinessCard(req.BusinessCardUrl)
|
|
|
+ aliyunResult, errMsg, err := services.AliyunOcrBusinessCard(req.BusinessCardUrl)
|
|
|
if err != nil {
|
|
|
br.Msg = "识别失败"
|
|
|
br.ErrMsg = "识别失败,Err:" + err.Error()
|
|
@@ -590,6 +590,10 @@ func (this *CompanyUserController) AddUser() {
|
|
|
br.ErrMsg = "识别失败"
|
|
|
return
|
|
|
}
|
|
|
+ if errMsg != "" {
|
|
|
+ br.Msg = errMsg
|
|
|
+ return
|
|
|
+ }
|
|
|
//如果百度没有识别出来手机号,那么还需要阿里识别出来的手机号校验下
|
|
|
if !isFlag {
|
|
|
if len(aliyunResult.TelCell) > 0 {
|
|
@@ -1972,7 +1976,7 @@ func (this *CompanyUserController) EditUser() {
|
|
|
|
|
|
if !isFlag {
|
|
|
//阿里云识别
|
|
|
- aliyunResult, err := services.AliyunOcrBusinessCard(req.BusinessCardUrl)
|
|
|
+ aliyunResult, errMsg, err := services.AliyunOcrBusinessCard(req.BusinessCardUrl)
|
|
|
if err != nil {
|
|
|
br.Msg = "识别失败"
|
|
|
br.ErrMsg = "识别失败,Err:" + err.Error()
|
|
@@ -1983,6 +1987,10 @@ func (this *CompanyUserController) EditUser() {
|
|
|
br.ErrMsg = "识别失败"
|
|
|
return
|
|
|
}
|
|
|
+ if errMsg != "" {
|
|
|
+ br.Msg = errMsg
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
mobileStr := strings.Join(aliyunResult.TelCell, ",")
|
|
|
if req.MobileOne != "" {
|
|
@@ -2497,7 +2505,7 @@ func (this *CompanyController) PotentialUserMove() {
|
|
|
if !isFlag {
|
|
|
//阿里云识别
|
|
|
//if utils.RunMode == "release" {
|
|
|
- aliyunResult, err := services.AliyunOcrBusinessCard(req.BusinessCardUrl)
|
|
|
+ aliyunResult, errMsg, err := services.AliyunOcrBusinessCard(req.BusinessCardUrl)
|
|
|
if err != nil {
|
|
|
br.Msg = "识别失败"
|
|
|
br.ErrMsg = "识别失败,Err:" + err.Error()
|
|
@@ -2508,6 +2516,10 @@ func (this *CompanyController) PotentialUserMove() {
|
|
|
br.ErrMsg = "识别失败"
|
|
|
return
|
|
|
}
|
|
|
+ if errMsg != "" {
|
|
|
+ br.Msg = errMsg
|
|
|
+ return
|
|
|
+ }
|
|
|
if len(aliyunResult.TelCell) > 0 {
|
|
|
mobileStr := strings.Join(aliyunResult.TelCell, ",")
|
|
|
if req.Mobile != "" {
|
|
@@ -5082,7 +5094,7 @@ func (this *CompanyController) ApplyRecordPotentialUserMove() {
|
|
|
if !isFlag {
|
|
|
//阿里云识别
|
|
|
//if utils.RunMode == "release" {
|
|
|
- aliyunResult, err := services.AliyunOcrBusinessCard(req.BusinessCardUrl)
|
|
|
+ aliyunResult, errMsg, err := services.AliyunOcrBusinessCard(req.BusinessCardUrl)
|
|
|
if err != nil {
|
|
|
br.Msg = "识别失败"
|
|
|
br.ErrMsg = "识别失败,Err:" + err.Error()
|
|
@@ -5093,6 +5105,10 @@ func (this *CompanyController) ApplyRecordPotentialUserMove() {
|
|
|
br.ErrMsg = "识别失败"
|
|
|
return
|
|
|
}
|
|
|
+ if errMsg != "" {
|
|
|
+ br.Msg = errMsg
|
|
|
+ return
|
|
|
+ }
|
|
|
if len(aliyunResult.TelCell) > 0 {
|
|
|
mobileStr := strings.Join(aliyunResult.TelCell, ",")
|
|
|
if req.Mobile != "" {
|