处理语音转文字返回状态

This commit is contained in:
sh
2026-01-23 19:08:45 +08:00
parent 2820710fa6
commit 0194405957

View File

@@ -36,7 +36,7 @@ public class AudioTextRequestClient {
if(response.isOk()){
String body = response.body();
JSONObject jsonObject = JSONObject.parseObject(body);
if("0".equals(jsonObject.getString("code"))){
if("0".equals(jsonObject.getString("code")) || "200".equals(jsonObject.getString("code"))){
return jsonObject.getString("text");
}else{
throw new RuntimeException("语音转文字接口调用失败: " + jsonObject.getString("error"));