diff --git a/src/views/App.vue b/src/views/App.vue index 543cc13a1dcbf6ef126d4e515674661def5fb060..5b2f91ae188e2ab9c729b5e36ead68b90730796e 100644 --- a/src/views/App.vue +++ b/src/views/App.vue @@ -85,6 +85,15 @@ export default { * 发布到社区后,将消耗运行者的额度 * 注意:如果部署应用,任何人通过部署后的域名访问应用时,都将消耗部署者的额度 */ + const body = { + messages: [ + { + role: 'user', + content: question + } + ], + apikey: apiKey + } const source = fetchEventSource(apiUrl, { method: 'POST', @@ -116,25 +125,13 @@ export default { console.log("error", err); } }); - const body = { - messages: [ - { - role: 'user', - content: question - } - ], - apikey: apiKey - } - const data = { - dialogs:this.dialogs - } - fetch("https://flask-wujiaping.inscode.cc/addhistory", { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(data) - }).then((res) => console.log(res.data) ) + axios({ + method: "post", + url: "https://flask-wujiaping.inscode.cc/addhistory", + data: this.dialogs, + }).then((res) => { + + }); }, handleNewChat() { this.dialogs = [];