|
@@ -13639,11 +13639,16 @@ ${message} 以及##参考资料 以文本格式输出项目概况,驱动性问
|
|
|
} catch (error) {
|
|
|
console.log("error_________________" + error);
|
|
|
try {
|
|
|
- var message = data.message;
|
|
|
- var jsonStart = message.indexOf("```json") + 7; // `+ 7` 是为了跳过 ```json
|
|
|
- var jsonEnd = message.indexOf("```", jsonStart);
|
|
|
- var jsonString = message.substring(jsonStart, jsonEnd).trim();
|
|
|
- dArray = JSON.parse(jsonString);
|
|
|
+ let regex = new RegExp("(?<=```json)([\\s\\S]*?)(?=```)");
|
|
|
+ let match = data.message.match(regex);
|
|
|
+ dArray = JSON.parse(match[0]);
|
|
|
+
|
|
|
+
|
|
|
+ // var message = data.message;
|
|
|
+ // var jsonStart = message.indexOf("```json") + 7; // `+ 7` 是为了跳过 ```json
|
|
|
+ // var jsonEnd = message.indexOf("```", jsonStart);
|
|
|
+ // var jsonString = message.substring(jsonStart, jsonEnd).trim();
|
|
|
+ // dArray = JSON.parse(jsonString);
|
|
|
} catch (error) {
|
|
|
console.log("error_________________" + error);
|
|
|
}
|
|
@@ -13865,11 +13870,15 @@ ${message} 以及##参考资料 以文本格式输出项目概况,驱动性问
|
|
|
} catch (error) {
|
|
|
console.log("error_________________" + error);
|
|
|
try {
|
|
|
- var message = data.message;
|
|
|
- var jsonStart = message.indexOf("```json") + 7; // `+ 7` 是为了跳过 ```json
|
|
|
- var jsonEnd = message.indexOf("```", jsonStart);
|
|
|
- var jsonString = message.substring(jsonStart, jsonEnd).trim();
|
|
|
- tArray = JSON.parse(jsonString);
|
|
|
+ let regex = new RegExp("(?<=```json)([\\s\\S]*?)(?=```)");
|
|
|
+ let match = data.message.match(regex);
|
|
|
+ tArray = JSON.parse(match[0]);
|
|
|
+
|
|
|
+ // var message = data.message;
|
|
|
+ // var jsonStart = message.indexOf("```json") + 7; // `+ 7` 是为了跳过 ```json
|
|
|
+ // var jsonEnd = message.indexOf("```", jsonStart);
|
|
|
+ // var jsonString = message.substring(jsonStart, jsonEnd).trim();
|
|
|
+ // tArray = JSON.parse(jsonString);
|
|
|
} catch (error) {
|
|
|
console.log("error_________________" + error);
|
|
|
}
|
|
@@ -14045,11 +14054,15 @@ ${this.teacherText[task].detail.replaceAll('#','').replaceAll('*','').replaceAll
|
|
|
} catch (error) {
|
|
|
console.log("error_________________" + error);
|
|
|
try {
|
|
|
- var message = data.message;
|
|
|
- var jsonStart = message.indexOf("```json") + 7; // `+ 7` 是为了跳过 ```json
|
|
|
- var jsonEnd = message.indexOf("```", jsonStart);
|
|
|
- var jsonString = message.substring(jsonStart, jsonEnd).trim();
|
|
|
- tArray = JSON.parse(jsonString);
|
|
|
+ let regex = new RegExp("(?<=```json)([\\s\\S]*?)(?=```)");
|
|
|
+ let match = data.message.match(regex);
|
|
|
+ tArray = JSON.parse(match[0]);
|
|
|
+
|
|
|
+ // var message = data.message;
|
|
|
+ // var jsonStart = message.indexOf("```json") + 7; // `+ 7` 是为了跳过 ```json
|
|
|
+ // var jsonEnd = message.indexOf("```", jsonStart);
|
|
|
+ // var jsonString = message.substring(jsonStart, jsonEnd).trim();
|
|
|
+ // tArray = JSON.parse(jsonString);
|
|
|
} catch (error) {
|
|
|
console.log("error_________________" + error);
|
|
|
}
|
|
@@ -14250,11 +14263,15 @@ ${this.teacherText[task].detail.replaceAll('#','').replaceAll('*','').replaceAll
|
|
|
} catch (error) {
|
|
|
console.log("error_________________" + error);
|
|
|
try {
|
|
|
- var message = data.message;
|
|
|
- var jsonStart = message.indexOf("```json") + 7; // `+ 7` 是为了跳过 ```json
|
|
|
- var jsonEnd = message.indexOf("```", jsonStart);
|
|
|
- var jsonString = message.substring(jsonStart, jsonEnd).trim();
|
|
|
- dArray = JSON.parse(jsonString);
|
|
|
+ let regex = new RegExp("(?<=```json)([\\s\\S]*?)(?=```)");
|
|
|
+ let match = data.message.match(regex);
|
|
|
+ dArray = JSON.parse(match[0]);
|
|
|
+
|
|
|
+ // var message = data.message;
|
|
|
+ // var jsonStart = message.indexOf("```json") + 7; // `+ 7` 是为了跳过 ```json
|
|
|
+ // var jsonEnd = message.indexOf("```", jsonStart);
|
|
|
+ // var jsonString = message.substring(jsonStart, jsonEnd).trim();
|
|
|
+ // dArray = JSON.parse(jsonString);
|
|
|
} catch (error) {
|
|
|
console.log("error_________________" + error);
|
|
|
}
|
|
@@ -14859,17 +14876,20 @@ ${msg} 优化评价维度和维度描述,输出格式和内容要求参考#
|
|
|
console.log("error_________________" + e);
|
|
|
// _this.$message.error(data.message)
|
|
|
try {
|
|
|
- // let _data = JSON.parse(data.message.match(/(?<=```json).*?(?=```)/)[0])
|
|
|
- var message = data.message;
|
|
|
- var jsonStart = message.indexOf("```json") + 7; // `+ 7` 是为了跳过 ```json
|
|
|
- var jsonEnd = message.indexOf("```", jsonStart);
|
|
|
- if (jsonStart !== -1 && jsonEnd !== -1) {
|
|
|
- var jsonString = message
|
|
|
- .substring(jsonStart, jsonEnd)
|
|
|
- .trim();
|
|
|
- var _data2 = JSON.parse(jsonString);
|
|
|
- _this.unitJson[0].chapterInfo[0].taskJson[_tindex2].eList = _data2
|
|
|
- }
|
|
|
+ let regex = new RegExp("(?<=```json)([\\s\\S]*?)(?=```)");
|
|
|
+ let match = data.message.match(regex);
|
|
|
+ _this.unitJson[0].chapterInfo[0].taskJson[_tindex2].eList = JSON.parse(match[0]);
|
|
|
+
|
|
|
+ // var message = data.message;
|
|
|
+ // var jsonStart = message.indexOf("```json") + 7; // `+ 7` 是为了跳过 ```json
|
|
|
+ // var jsonEnd = message.indexOf("```", jsonStart);
|
|
|
+ // if (jsonStart !== -1 && jsonEnd !== -1) {
|
|
|
+ // var jsonString = message
|
|
|
+ // .substring(jsonStart, jsonEnd)
|
|
|
+ // .trim();
|
|
|
+ // var _data2 = JSON.parse(jsonString);
|
|
|
+ // _this.unitJson[0].chapterInfo[0].taskJson[_tindex2].eList = _data2
|
|
|
+ // }
|
|
|
} catch (error) {
|
|
|
}
|
|
|
}
|