|
|
@@ -174,8 +174,12 @@ func (s *ImageRecordService) ImageIdentify(record levelMonitor.ImageRecord, key
|
|
|
re := regexp.MustCompile(identifyPattern)
|
|
|
// 使用正则表达式查找价格信息
|
|
|
level := re.FindAllString(data.WordsResult[0].Words, -1)
|
|
|
- l, _ := strconv.ParseFloat(level[0], 64)
|
|
|
- identify = l
|
|
|
+ if len(level) == 0 {
|
|
|
+ identify = 0
|
|
|
+ } else {
|
|
|
+ l, _ := strconv.ParseFloat(level[0], 64)
|
|
|
+ identify = l
|
|
|
+ }
|
|
|
} else {
|
|
|
identify = i
|
|
|
}
|