|
@@ -19451,9 +19451,9 @@ ${this.courseText && this.aiCallBack[0] == 2 ? '注意,优化原有的<参考
|
|
|
} catch (error) {
|
|
|
console.log("error_________________" + error);
|
|
|
try {
|
|
|
- let regex = new RegExp("(?<=```json)([\\s\\S]*?)(?=```)");
|
|
|
+ let regex = new RegExp(/```json([\s\S]*?)```/);
|
|
|
let match = data.message.match(regex);
|
|
|
- dArray = JSON.parse(match[0]);
|
|
|
+ dArray = JSON.parse(match[1]);
|
|
|
|
|
|
|
|
|
// var message = data.message;
|
|
@@ -19463,11 +19463,11 @@ ${this.courseText && this.aiCallBack[0] == 2 ? '注意,优化原有的<参考
|
|
|
// dArray = JSON.parse(jsonString);
|
|
|
} catch (error) {
|
|
|
try {
|
|
|
- let regex = new RegExp("(?<=```json)([\\s\\S]*?)(?=```)");
|
|
|
+ let regex = new RegExp(/```json([\s\S]*?)```/);
|
|
|
let match = data.message.match(regex);
|
|
|
// eval("var aaa = " + match[0])
|
|
|
- if(match && match[0]){
|
|
|
- dArray = JSON.parse(match[0].replace(/\n/g, ' ').replace(/\s{2,}/g, ' '));
|
|
|
+ if(match && match[1]){
|
|
|
+ dArray = JSON.parse(match[1].replace(/\n/g, ' ').replace(/\s{2,}/g, ' '));
|
|
|
}else {
|
|
|
dArray = JSON.parse(data.message.replace(/\n/g, ' ').replace(/\s{2,}/g, ' '));
|
|
|
}
|