|
@@ -18115,7 +18115,11 @@ ${this.courseText && this.aiCallBack[0] == 2 ? '注意,优化原有的<参考
|
|
|
let regex = new RegExp("(?<=```json)([\\s\\S]*?)(?=```)");
|
|
|
let match = data.message.match(regex);
|
|
|
// eval("var aaa = " + match[0])
|
|
|
- dArray = JSON.parse(match[0].replace(/\n/g, ' ').replace(/\s{2,}/g, ' '));
|
|
|
+ if(match && match[0]){
|
|
|
+ dArray = JSON.parse(match[0].replace(/\n/g, ' ').replace(/\s{2,}/g, ' '));
|
|
|
+ }else {
|
|
|
+ dArray = JSON.parse(data.message.replace(/\n/g, ' ').replace(/\s{2,}/g, ' '));
|
|
|
+ }
|
|
|
|
|
|
} catch (error) {
|
|
|
_this.$message.error('返回json格式不正确')
|