Explorar el Código

fix: 语音识别-文件重名校验

hsun hace 11 meses
padre
commit
f097bca95d
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      controllers/speech_recognition/speech_recognition.go

+ 4 - 2
controllers/speech_recognition/speech_recognition.go

@@ -1122,7 +1122,7 @@ func (this *SpeechRecognitionController) CheckFileName() {
 		return
 	}
 
-	var checkResult bool
+	checkResult := true
 	speechOb := new(speech_recognition.SpeechRecognition)
 	cond := fmt.Sprintf(` AND %s = ?`, speech_recognition.SpeechRecognitionCols.FileName)
 	pars := make([]interface{}, 0)
@@ -1134,7 +1134,9 @@ func (this *SpeechRecognitionController) CheckFileName() {
 		return
 	}
 	if exists != nil && exists.SpeechRecognitionId > 0 {
-		checkResult = true
+		checkResult = false
+		br.Data = checkResult
+		br.Msg = fmt.Sprintf("相同文件名称已存在: %s", req.FileName)
 		return
 	}