|
@@ -54,7 +54,7 @@ class Index extends BaseController{
|
|
|
$res = array('error' => 1, 'errortip' => '任务创建失败', 'result' => $result);
|
|
|
exit(json_encode($res,JSON_UNESCAPED_UNICODE));
|
|
|
}
|
|
|
- print_r($result);
|
|
|
+// print_r($result);
|
|
|
die;
|
|
|
ajax_return(array('error' => $this->error, 'errortip' => $this->errortip, 'result' => array()));
|
|
|
}
|
|
@@ -75,21 +75,42 @@ class Index extends BaseController{
|
|
|
// print_r($taskone);
|
|
|
//判断返回输出结果
|
|
|
if($taskone['body']['Code'] == '0' && $taskone['body']['Message'] == 'success'){
|
|
|
- $result = array();
|
|
|
- $result['TaskId'] = $taskone['body']['Data']['TaskId'];
|
|
|
- $result['TaskKey'] = $taskone['body']['Data']['TaskKey'];
|
|
|
- $result['TaskStatus'] = $taskone['body']['Data']['TaskStatus'];
|
|
|
- $result['Result']['Transcription'] = $taskone['body']['Data']['Result']['Transcription']?$taskone['body']['Data']['Result']['Transcription']:'';
|
|
|
- $result['Result']['CustomPrompt'] = $taskone['body']['Data']['Result']['CustomPrompt']?$taskone['body']['Data']['Result']['CustomPrompt']:'';
|
|
|
|
|
|
- $res = array('error' => 0, 'errortip' => '任务解析成功', 'result' => $result);
|
|
|
- exit(json_encode($res,JSON_UNESCAPED_UNICODE));
|
|
|
+ if($taskone['body']['Data']['TaskStatus'] == 'COMPLETED'){//任务完成
|
|
|
+ $result = array();
|
|
|
+ $result['TaskId'] = $taskone['body']['Data']['TaskId'];
|
|
|
+ $result['TaskKey'] = $taskone['body']['Data']['TaskKey'];
|
|
|
+ $result['TaskStatus'] = $taskone['body']['Data']['TaskStatus'];
|
|
|
+ $result['Result']['Transcription'] = $taskone['body']['Data']['Result']['Transcription']?$taskone['body']['Data']['Result']['Transcription']:'';
|
|
|
+ $result['Result']['CustomPrompt'] = $taskone['body']['Data']['Result']['CustomPrompt']?$taskone['body']['Data']['Result']['CustomPrompt']:'';
|
|
|
+
|
|
|
+ $res = array('error' => 0, 'errortip' => '任务解析成功', 'result' => $result);
|
|
|
+ exit(json_encode($res,JSON_UNESCAPED_UNICODE));
|
|
|
+ }else{
|
|
|
+ $result = array();
|
|
|
+ $res = array('error' => 1, 'errortip' => '任务解析失败', 'result' => $result);
|
|
|
+ exit(json_encode($res,JSON_UNESCAPED_UNICODE));
|
|
|
+ }
|
|
|
+
|
|
|
+// elseif($taskone['body']['Data']['Result']['ONGOING']){//任务进行中
|
|
|
+//
|
|
|
+// $res = array('error' => 1, 'errortip' => '任务解析失败', 'result' => array());
|
|
|
+// exit(json_encode($res,JSON_UNESCAPED_UNICODE));
|
|
|
+// }elseif($taskone['body']['Data']['Result']['FAILED']){//任务失败
|
|
|
+//
|
|
|
+// $res = array('error' => 1, 'errortip' => '任务解析失败', 'result' => array());
|
|
|
+// exit(json_encode($res,JSON_UNESCAPED_UNICODE));
|
|
|
+// }elseif($taskone['body']['Data']['Result']['INVALID']){//无效任务
|
|
|
+//
|
|
|
+// $res = array('error' => 1, 'errortip' => '任务解析失败', 'result' => array());
|
|
|
+// exit(json_encode($res,JSON_UNESCAPED_UNICODE));
|
|
|
+// }
|
|
|
}else{
|
|
|
$result = array();
|
|
|
$res = array('error' => 1, 'errortip' => '任务解析失败', 'result' => $result);
|
|
|
exit(json_encode($res,JSON_UNESCAPED_UNICODE));
|
|
|
}
|
|
|
- print_r($result);
|
|
|
+// print_r($result);
|
|
|
die;
|
|
|
ajax_return(array('error' => $this->error, 'errortip' => $this->errortip, 'result' => array()));
|
|
|
}
|