|
@@ -604,6 +604,10 @@ export default {
|
|
type: Object,
|
|
type: Object,
|
|
default: () => {}
|
|
default: () => {}
|
|
},
|
|
},
|
|
|
|
+ itemType: {
|
|
|
|
+ type: Number,
|
|
|
|
+ default: 0
|
|
|
|
+ },
|
|
navList: {
|
|
navList: {
|
|
type: Array,
|
|
type: Array,
|
|
default: () => []
|
|
default: () => []
|
|
@@ -1229,7 +1233,6 @@ ${_textData}
|
|
file_ids: this.fileId,
|
|
file_ids: this.fileId,
|
|
model: "gpt-4o-2024-11-20"
|
|
model: "gpt-4o-2024-11-20"
|
|
};
|
|
};
|
|
-
|
|
|
|
this.ajax
|
|
this.ajax
|
|
// .post("https://gpt4.cocorobo.cn/chat", params)
|
|
// .post("https://gpt4.cocorobo.cn/chat", params)
|
|
// .post("https://claude3.cocorobo.cn/chat", params)
|
|
// .post("https://claude3.cocorobo.cn/chat", params)
|
|
@@ -1237,7 +1240,7 @@ ${_textData}
|
|
.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("```", "");
|
|
- const match = _data.match(/\[\s*\{[\s\S]*?\}\s*\]/);
|
|
|
|
|
|
+ const match = _data.match(/\[\s*\{[\s\S]*?\}\s*\]/);
|
|
let _result = JSON.parse(match[0]) || [];
|
|
let _result = JSON.parse(match[0]) || [];
|
|
_result.forEach(i => {
|
|
_result.forEach(i => {
|
|
i.answer2 = i.answer.length ? [] : "";
|
|
i.answer2 = i.answer.length ? [] : "";
|
|
@@ -1251,13 +1254,17 @@ ${_textData}
|
|
this.saveTaskList(1);
|
|
this.saveTaskList(1);
|
|
// this.$message.success("一键出题成功");
|
|
// this.$message.success("一键出题成功");
|
|
} else {
|
|
} else {
|
|
- this.$message.error("一键出题失败");
|
|
|
|
|
|
+ if (this.itemType == 2) {
|
|
|
|
+ this.$message.error("一键出题失败");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
this.aiBoxLoading = false;
|
|
this.aiBoxLoading = false;
|
|
})
|
|
})
|
|
.catch(e => {
|
|
.catch(e => {
|
|
this.aiBoxLoading = false;
|
|
this.aiBoxLoading = false;
|
|
- this.$message.error("一键出题失败");
|
|
|
|
|
|
+ if (this.itemType == 2) {
|
|
|
|
+ this.$message.error("一键出题失败");
|
|
|
|
+ }
|
|
console.log(e);
|
|
console.log(e);
|
|
});
|
|
});
|
|
this.insertMemorandum(
|
|
this.insertMemorandum(
|