commit 8.5

This commit is contained in:
WangXiaoDong
2023-08-05 12:52:56 +08:00
parent 913b100ac9
commit b28d6585fa
21 changed files with 2020 additions and 772 deletions

View File

@@ -80,26 +80,6 @@ export default defineComponent({
this.textScroll()
let userInfo:any = getCookie("userInfo")
this.userInfo = JSON.parse(userInfo);
console.log(22);
const data = {
"user_id": "83",
"session_id": "",
"message": "Hello, can you tell me what holiday is on July 1st",
};
axios.post('/api/python/chatStream', data, {onDownloadProgress: (progressEvent) => {
// console.log(11);
// num = progressEvent.event.currentTarget.response
console.log(progressEvent);
},
}).then((res)=>{
console.log(res);
}).catch((response) => {
console.log(response);
// var res = http.responseText
});
},
directives:{
fade:{
@@ -168,46 +148,33 @@ const data = {
"session_id":""
}
console.log(getCookie('token'));
let interaction = {onDownloadProgress: (progressEvent:any) => {
this.clearTimer()
console.log(progressEvent);
console.log(progressEvent.event.currentTarget.response);
if(a){
this.dialogue.push({
state:1,
// str:progressEvent.event.currentTarget.response
})
a = false
}else{
this.dialogue[this.dialogue.length].str = progressEvent.event.currentTarget.response
}
// if(a){
// this.dialogue.push({
// state:1,
// str:progressEvent.event.currentTarget.response
// })
// a = false
// }else{
// this.dialogue[this.dialogue.length].str = progressEvent.event.currentTarget.response
// }
},
}
// Https.axiosPost(Https.httpUrls.pythonChatStream, data,interaction).then(
// (rv: any) => {
// a = true
// this.createTimer()
// }
// ).catch(res=>{
// this.createTimer()
// });
Https.axiosPost(Https.httpUrls.pythonChatStream, data,interaction).then(
(rv: any) => {
a = true
this.createTimer()
}
).catch(res=>{
this.createTimer()
});
// new Promise((resolve, reject) => {
axios.post('/api/python/chatStream', data, {onDownloadProgress: (progressEvent) => {
// console.log(11);
// num = progressEvent.event.currentTarget.response
console.log(progressEvent);
},
}).then((res)=>{
console.log(res);
}).catch((response) => {
console.log(response);
// var res = http.responseText
});
// axios.post("/api/python/chatStream", data,{
// onDownloadProgress: (progressEvent:any) => {
@@ -233,7 +200,7 @@ const data = {
// })
// });
// });
this.chatCentent = ""
this.textScroll()
@@ -266,15 +233,17 @@ const data = {
<style lang="less" scoped>
.robot{
position: absolute;
bottom: 25px;
right: 50px;
bottom: .5rem;
// bottom: 2.5rem;
right: 2.5rem;
// right: 5rem;
z-index: 9999;
// width: 400px;
.robot_top{
// width: 70%;
width: 250px;
width: 25rem;
margin-left: auto;
height: 140px;
height: 14rem;
overflow-x: hidden;
transition: .3s all;
opacity: 0;
@@ -284,15 +253,15 @@ const data = {
}
&.robot_top::-webkit-scrollbar{display: none;}
.robot_text{
font-size: 14px;
padding: 5px 10px;
font-size: 1.4rem;
padding: .5rem 1rem;
display: inline-block;
border-radius: 20px;
border-radius: 2rem;
max-width: 80%;
}
.text_left,.text_right{
margin: 20px 0;
font-size: 12px;
margin: 2rem 0;
font-size: 1.2rem;
}
.text_left{
display: flex;
@@ -327,14 +296,14 @@ const data = {
transition: .3s all;
opacity: 0;
display: none;
margin-right: 40px;
margin-right: 4rem;
&.active{
opacity: 1;
}
input{
border: none;
font-size: 12px;
width: 250px;
font-size: 1.2rem;
width: 25rem;
}
.robot_btn{
display: flex;
@@ -352,8 +321,7 @@ const data = {
.robot_img{
margin-left: auto;
img{
width: 100px;
width: 80px;
width: 8rem;
// margin-left: 40px;
cursor: pointer;