fix: bug
This commit is contained in:
@@ -169,6 +169,14 @@ export const textChartPreviewApi = (data) => {
|
||||
};
|
||||
|
||||
|
||||
export const previewAfreshStudyCourse = (data) => {
|
||||
return request({
|
||||
url: base_url + '/traStdyInfo/previewAfreshStudyCourse',
|
||||
method: 'post',
|
||||
toastErrors: true,
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
// 设置学习顾问音色/traStdyTeacher/setStudyTeacher
|
||||
export const setStudyTeacherApi = (data) => {
|
||||
|
||||
@@ -151,7 +151,8 @@
|
||||
queryQuestionEvalateApi,
|
||||
textChartApi,
|
||||
setStudyTeacherApi,
|
||||
textChartPreviewApi
|
||||
textChartPreviewApi,
|
||||
previewAfreshStudyCourse
|
||||
} from "@/api/study.js"
|
||||
import common from '@/common/common';
|
||||
import TalkingItem from '@/pages/course/components/talkingItem.vue'
|
||||
@@ -225,7 +226,8 @@
|
||||
"commond": 'STDY',
|
||||
"body": {
|
||||
crsId: crsId.value,
|
||||
teacherNo: choiceTeacher.value
|
||||
teacherNo: choiceTeacher.value,
|
||||
studyType: isPreview.value ? 'P' : 'S'
|
||||
}
|
||||
})
|
||||
return
|
||||
@@ -239,7 +241,8 @@
|
||||
"commond": 'STDY',
|
||||
"body": {
|
||||
crsId: crsId.value,
|
||||
teacherNo: choiceTeacher.value
|
||||
teacherNo: choiceTeacher.value,
|
||||
studyType: isPreview.value ? 'P' : 'S'
|
||||
}
|
||||
})
|
||||
step.value = 2
|
||||
@@ -258,7 +261,8 @@
|
||||
};
|
||||
// 重新学习
|
||||
const resStartStudyNow = () => {
|
||||
afreshStudyCourseApi({
|
||||
let _ajax = isPreview.value ? previewAfreshStudyCourse : afreshStudyCourseApi
|
||||
_ajax({
|
||||
crsId: crsId.value,
|
||||
}).then(res => {
|
||||
step.value = 1
|
||||
@@ -359,7 +363,8 @@
|
||||
"commond": 'STDY',
|
||||
"body": {
|
||||
crsId: crsId.value,
|
||||
teacherNo: choiceTeacher.value
|
||||
teacherNo: choiceTeacher.value,
|
||||
studyType: isPreview.value ? 'P' : 'S'
|
||||
}
|
||||
})
|
||||
step.value = 2
|
||||
|
||||
@@ -262,7 +262,7 @@
|
||||
height: 12rpx;
|
||||
border-right: 4rpx solid #333;
|
||||
border-bottom: 4rpx solid #333;
|
||||
transform: rotate(45deg);
|
||||
transform: rotate(135deg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@
|
||||
.link-info {
|
||||
&::after {
|
||||
top: 18rpx;
|
||||
transform: rotate(135deg);
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -321,8 +321,9 @@
|
||||
answerIsOver.value = true
|
||||
} else if (body.event === 'sourceDocuments') {
|
||||
console.log('回答返回文件列表!')
|
||||
console.log('body: ',body)
|
||||
if (talkingList.value.length === 0) return
|
||||
let _data = JSON.parse(body.data) || {}
|
||||
let _data = body.data
|
||||
talkingList.value[talkingList.value.length - 1].talkingFiles = _data.knowledgeList||[]
|
||||
talkingList.value[talkingList.value.length - 1].talkingCrsList = _data.crsList||[]
|
||||
}
|
||||
@@ -472,7 +473,21 @@
|
||||
console.log(res)
|
||||
|
||||
talkingList.value = (res.body || []).map((t,index)=> {
|
||||
let _text = t.respContent.replace(/\\n/g, `\n`);
|
||||
// let _obj = JSON.parse( t.respContent)
|
||||
// console.log(_obj,0)
|
||||
// if(t.chatRole === 'TCH'){
|
||||
// console.log(JSON.parse(_obj),1)
|
||||
// }
|
||||
let _text
|
||||
let _talkingCrsList
|
||||
let _talkingFiles
|
||||
if(t.chatRole === 'TCH'){
|
||||
_text = t.respContentVo?.messageBuileder|| ''
|
||||
_talkingCrsList = t.respContentVo?.resultMap?.crsList||[]
|
||||
_talkingFiles = t.respContentVo?.resultMap?.knowledgeList||[]
|
||||
}else{
|
||||
_text = t.respContent
|
||||
}
|
||||
return {
|
||||
type: t.chatRole === 'TCH'? 'answer':'question',
|
||||
talkingText: _text,
|
||||
@@ -487,6 +502,8 @@
|
||||
bucketKey: '',
|
||||
downvoteStat: t.downvoteStat,
|
||||
likeStat: t.likeStat,
|
||||
talkingCrsList: _talkingCrsList,
|
||||
talkingFiles: _talkingFiles
|
||||
}
|
||||
})
|
||||
historyRef.value.close()
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ export const useSocketStore = defineStore('socketStore',{
|
||||
if(this.SocketObj?.isClose){
|
||||
this.SocketObj.isClose = false
|
||||
}
|
||||
let _baseUrl = get_base_url().split('http').join('ws')
|
||||
let _baseUrl = get_base_url(url).split('http').join('ws')
|
||||
this.SocketObj = new SocketClass(_baseUrl + url + getToken());
|
||||
},
|
||||
closeSocket() {
|
||||
|
||||
Reference in New Issue
Block a user