|
@@ -57,7 +57,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="tt_i_b_item" style="width: 290px;">
|
|
|
|
|
|
|
+ <div class="tt_i_b_item" style="flex: 1;">
|
|
|
<div class="tt_i_b_title">{{ lang.ssCommunication }}</div>
|
|
<div class="tt_i_b_title">{{ lang.ssCommunication }}</div>
|
|
|
<div class="tt_i_b_box" >
|
|
<div class="tt_i_b_box" >
|
|
|
<div class="tt_i_b_b_item">
|
|
<div class="tt_i_b_b_item">
|
|
@@ -1367,20 +1367,26 @@ ${taskText}
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
let _data = res.data.FunctionResponse.message;
|
|
let _data = res.data.FunctionResponse.message;
|
|
|
_data = _data.replaceAll("```json", "").replaceAll("```", "");
|
|
_data = _data.replaceAll("```json", "").replaceAll("```", "");
|
|
|
|
|
+ console.log(_data,'_data');
|
|
|
|
|
+
|
|
|
const match = _data.match(
|
|
const match = _data.match(
|
|
|
- /{[^{}]*"teststitle"[\s\S]*?"end":\s*""[^{}]*}/
|
|
|
|
|
|
|
+ /\{"teststitle"[\s\S]*?end\s*:\s*""\s*\}/
|
|
|
);
|
|
);
|
|
|
- let _result = JSON.parse(match[0]);
|
|
|
|
|
- (_result.answer2 = _result.answer.length ? [] : ""),
|
|
|
|
|
- (_result.uuid = uuidv4());
|
|
|
|
|
- delete _result.end;
|
|
|
|
|
- this.topicList.splice(this.showTopicIndex + 1, 0, _result);
|
|
|
|
|
- // this.saveTaskList(1);
|
|
|
|
|
- this.saveTaskList(2).then(_ => {
|
|
|
|
|
- this.saveTaskList().then(_ => {
|
|
|
|
|
- this.next();
|
|
|
|
|
|
|
+ if (match && match[0]) {
|
|
|
|
|
+ // 修复 end:"" 为 "end":"" 以符合JSON格式
|
|
|
|
|
+ let jsonStr = match[0].replace(/([{,]\s*)end\s*:\s*""/g, '$1"end":""');
|
|
|
|
|
+ let _result = JSON.parse(jsonStr);
|
|
|
|
|
+ (_result.answer2 = _result.answer.length ? [] : ""),
|
|
|
|
|
+ (_result.uuid = uuidv4());
|
|
|
|
|
+ delete _result.end;
|
|
|
|
|
+ this.topicList.splice(this.showTopicIndex + 1, 0, _result);
|
|
|
|
|
+ // this.saveTaskList(1);
|
|
|
|
|
+ this.saveTaskList(2).then(_ => {
|
|
|
|
|
+ this.saveTaskList().then(_ => {
|
|
|
|
|
+ this.next();
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
- });
|
|
|
|
|
|
|
+ }
|
|
|
this.aiBoxLoading = false;
|
|
this.aiBoxLoading = false;
|
|
|
})
|
|
})
|
|
|
.catch(e => {
|
|
.catch(e => {
|