lsc 11 ماه پیش
والد
کامیت
b001c92d0e

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.d5091773230f947910d5ffc89c7e0795.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.571c38d63f24b1ae9e16.js></script><script type=text/javascript src=./static/js/vendor.35dfb1d95a63059f336f.js></script><script type=text/javascript src=./static/js/app.7dd6c259c6159da23fb1.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.0e52a78682e2991b73e20cbb678e777a.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.571c38d63f24b1ae9e16.js></script><script type=text/javascript src=./static/js/vendor.35dfb1d95a63059f336f.js></script><script type=text/javascript src=./static/js/app.5b1d0843d1607ea8974e.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/static/css/app.0e52a78682e2991b73e20cbb678e777a.css


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/static/css/app.0e52a78682e2991b73e20cbb678e777a.css.map


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/static/js/app.5b1d0843d1607ea8974e.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/static/js/app.5b1d0843d1607ea8974e.js.map


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/static/js/manifest.571c38d63f24b1ae9e16.js.map


+ 126 - 35
src/components/pages/aiAddCourse/addCourse.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="pb_content" style="background: #f0f2f5" v-loading="loading" element-loading-text="小可正在努力生成中,请稍等...">
     <div class="c_pub_button_confirm stopBtn" v-if="loading && isOutlineCancelToken" @click="cancelAjax('outline')">停止</div>
+    <div class="c_pub_button_confirm stopBtn" v-if="loading && isTeacherTaskCancelToken" @click="cancelAjax('teacherTask')">停止</div>
     <div class="pb_content_body" style="position: relative; margin: 0">
       <div class="right" :style="{width:istemplate == 1 ? 'calc(100% - 300px)' : '100%'}">
         <div class="courseTop">
@@ -527,7 +528,8 @@
                 </div>
               </div>
             </div>
-            <div class="whiteBg" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-loading="teacherTextLoading" element-loading-text="小可正在努力生成中,请稍等..." v-if="(!yiKeTemplateArray.includes(templateid)) && isuseT">
+            <div class="whiteBg" :style="{ minHeight: teacherTextLoading ? '250px' : 'auto'}" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;position: relative" v-loading="teacherTextLoading" element-loading-text="小可正在努力生成中,请稍等..." v-if="(!yiKeTemplateArray.includes(templateid)) && isuseT">
+              <div class="c_pub_button_confirm stopBtn" v-if="teacherTextLoading && isTeacherTextCancelToken" @click="cancelAjax('teacherText')">停止</div>
               <div class="whiteBg" style="border-radius: 0; margin-top: 15px">
                 <div class="c_info_title">
                   已有教案摘要
@@ -558,7 +560,8 @@
                 </div>
               </div>
             </div>
-            <div class="whiteBg" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-loading="targetTextLoading" element-loading-text="小可正在努力生成中,请稍等..." v-if="(!yiKeTemplateArray.includes(templateid)) && isuseT">
+            <div class="whiteBg" :style="{ minHeight: targetTextLoading ? '250px' : 'auto'}" style="background: #fff; margin: 0 0 10px;padding: 0 0 15px;" v-loading="targetTextLoading" element-loading-text="小可正在努力生成中,请稍等..." v-if="(!yiKeTemplateArray.includes(templateid)) && isuseT">
+              <div class="c_pub_button_confirm stopBtn" v-if="targetTextLoading && isTargetCancelToken1" @click="cancelAjax('target1')">停止</div>
               <div class="whiteBg" style="border-radius: 0; margin-top: 15px">
                 <div class="c_info_title">
                   课程目标
@@ -1398,7 +1401,8 @@
                         <button class="c_pub_button_confirm2" style="margin: 0px 0px 0px 5px;" @click="deleteTask2(index)" v-if="unitJson[0].chapterInfo[0].taskJson.length > 1">删除</button>
                       </div>
                     </div>
-                    <div class="outline_detail" v-loading="taskDetailLoading.indexOf('task-' + index) !== -1" element-loading-text="小可正在努力生成中,请稍等...">
+                    <div class="outline_detail" :style="{ minHeight: taskDetailLoading.indexOf('task-' + index) !== -1 ? '250px' : 'auto'}" v-loading="taskDetailLoading.indexOf('task-' + index) !== -1" element-loading-text="小可正在努力生成中,请稍等...">
+                      <div div class="c_pub_button_confirm stopBtn" v-if="taskDetailLoading.indexOf('task-' + index) !== -1 && isOutlineTaskCancelToken[index]" @click="cancelAjax('outlineTask', index)">停止</div>
                       <textarea v-autoHeight="100" rows="4" class="binfo_input binfo_textarea" cols
                         placeholder="请输入任务描述" v-model="item.taskDetail2" v-if="item.isTask2"></textarea>
                       <div class="markBox vditor-reset" style="white-space:pre-wrap;" v-text="item.taskDetail2" v-else-if="ttaskDetailLoading.indexOf('task-' + index) !== -1"></div>
@@ -1543,7 +1547,7 @@
                    </el-tooltip>
                     <button class="c_pub_button_confirm" style="margin: 0 20px 0 auto;"
                       @click="openAiDialog2(2, 'aiTeacher2')" v-if="panTeacher() > 0 && istemplate != 1">重新生成教案</button>
-                  <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom" v-if="panTeacher() == 0 && istemplate == 1 && templateid == '4480d65a-1e48-11ef-bee5-005056b86db5' && templateid != 'cf5722a4-401b-11ef-b873-005056b86dc3'">
+                  <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom" v-if="panTeacher() == 0 && istemplate == 1 && (templateid == '4480d65a-1e48-11ef-bee5-005056b86db5' || templateid == 'cf5722a4-401b-11ef-b873-005056b86dc3')">
                       <button class="c_pub_button_confirm" style="margin: 0 20px 0 auto;"
                       @contextmenu.prevent="openAiDialog(1, 'aiTeacher3')"
                       @click="openAiDialog(2, 'aiTeacher3')">生成教案</button>
@@ -7314,12 +7318,20 @@ export default {
       pingjiainfoisFinishSize: [],
       pingjiainfoisAllSize: [],
       pingjiainfoprogress: [],
-      isOutlineCancelToken: null,
       taskGLoading: [],
+      isOutlineCancelToken: null,
       isFileCancelToken: null,
       isTargetCancelToken1: null,
       isTargetCancelToken2: null,
       isTextCancelToken: null,
+      isTeacherTextCancelToken: null,
+      isTeacherTaskCancelToken: null,
+      isOutlineTaskCancelToken: [],
+      isTextCancelSource: null,
+      isOutlineTaskCancelSource: [],
+      isTeacherTextCancelSource: null,
+      isTargetCancelSource1: null,
+      isTargetCancelSource2: null,
     };
   },
   directives: {
@@ -16869,21 +16881,23 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
     },
     aiGetgetAiContent(_uid) {
       // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
-      let _source = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
+      this.isTextCancelSource = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       // let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       let _allText = "";
       let _mdText = "";
       let _iindex = 0
-      _source.onmessage = _e => {
+      this.isTextCancelSource.onmessage = _e => {
         let _eData = JSON.parse(_e.data).content;
         if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
           //对话已经完成
           _mdText = _mdText.replace("_", "");
-          _source.close();
+          this.isTextCancelSource.close();
+          this.isTextCancelSource = null;
           this.courseText = _mdText;
           this.textLoading = false
           this.ttextLoading = false
           this.courseTextB = false
+          this.isTextCancelToken = null
           return;
         } else {
           _iindex++
@@ -17201,7 +17215,7 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
           console.log(error);
         });
     },
-    cancelAjax(type){
+    cancelAjax(type, index){
       if (this.isOutlineCancelToken && type == 'outline') {
         this.$message.success("已经成功停止生成课程大纲")
         this.isOutlineCancelToken.cancel('Request canceled by the user.');
@@ -17220,6 +17234,10 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
         this.isTextCancelToken = null;
         this.textLoading = false
         this.ttextLoading = true
+        if(this.isTextCancelSource){
+          this.isTextCancelSource.close()
+          this.isTextCancelSource = null
+        }
       }
       if(this.isTargetCancelToken2 && type == 'target2'){
         this.$message.success("已经成功停止生成目标")
@@ -17227,6 +17245,49 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
         this.isTargetCancelToken2 = null;
         this.targetTextLoading2 = false
         this.ttargetTextLoading2 = false
+        if(this.isTargetCancelSource2){
+          this.isTargetCancelSource2.close()
+          this.isTargetCancelSource2 = null
+        }
+      }
+      if(this.isTargetCancelToken1 && type == 'target1'){
+        this.$message.success("已经成功停止生成目标")
+        this.isTargetCancelToken1.cancel('Request canceled by the user.');
+        this.isTargetCancelToken1 = null;
+        this.targetTextLoading = false
+        this.ttargetTextLoading = false
+        if(this.isTargetCancelSource1){
+          this.isTargetCancelSource1.close()
+          this.isTargetCancelSource1 = null
+        }
+      }
+      if(this.isTeacherTextCancelToken && type == 'teacherText'){
+        this.$message.success("已经成功停止提取摘要")
+        this.isTeacherTextCancelToken.cancel('Request canceled by the user.');
+        this.isTeacherTextCancelToken = null;
+        this.teacherTextLoading = false
+        this.tteacherTextLoading = false
+        if(this.isTeacherTextCancelSource){
+          this.isTeacherTextCancelSource.close()
+          this.isTeacherTextCancelSource = null
+        }
+      }
+      if(this.isTeacherTaskCancelToken && type == 'teacherTask'){
+        this.$message.success("已经成功停止生成教案")
+        this.isTeacherTaskCancelToken.cancel('Request canceled by the user.');
+        this.isTeacherTaskCancelToken = null;
+        this.loading = false
+      }
+      if(this.isOutlineTaskCancelToken && type == 'outlineTask'){
+        this.$message.success("已经成功停止生成大纲")
+        this.isOutlineTaskCancelToken[index].cancel('Request canceled by the user.');
+        this.isOutlineTaskCancelToken[index] = null;
+        this.taskDetailLoading.splice(this.taskDetailLoading.indexOf('task-' + index), 1)
+        this.ttaskDetailLoading.splice(this.ttaskDetailLoading.indexOf('task-' + index), 1)
+        if(this.isOutlineTaskCancelSource[index]){
+          this.isOutlineTaskCancelSource[index].close()
+          this.isOutlineTaskCancelSource[index] = null
+        }
       }
     },
     async aiGetTask2(messages, callback) {
@@ -17623,7 +17684,7 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
       //   _this.loading = false
       //   console.log(error);
       // });
-
+      _this.isTeacherTaskCancelToken = _this.ajax.setCancelSource();
       let parm = {
         assistant_id: '6063369f-289a-11ef-8bf4-12e77c4cb76b',
         message: [{"type":"text", "text":messages.replaceAll('\n', " ").replaceAll('*', "")}],
@@ -17634,7 +17695,7 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
         temperature: 0.1,
       }
       this.ajax
-        .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
+        .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm, _this.isTeacherTaskCancelToken)
         .then((response) => {
           console.log(response);
           let data = response.data.FunctionResponse
@@ -17757,9 +17818,11 @@ ${this.courseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内
             }, 0)
           }
           callback ? callback() : ''
+          _this.isTeacherTaskCancelToken = null
         })
         .catch((error) => {
           _this.loading = false
+          _this.isTeacherTaskCancelToken = null
           console.log(error);
         });
     },
@@ -19312,6 +19375,7 @@ ${msg}
 // - 补充描述:${_this.courseText2}
       _this.taskDetailLoading.push(_tindex)
       _this.ttaskDetailLoading.push(_tindex)
+      _this.isOutlineTaskCancelToken[index] = _this.ajax.setCancelSource();
       let _uuid = uuidv4();
       // let params = JSON.stringify({
       //   // "model": "Chat",
@@ -19367,31 +19431,33 @@ ${msg}
         } else {
           _this.$message.warning(response.data.FunctionResponse.result);
         }
-
+        _this.isOutlineTaskCancelToken[index] = null
         // _this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
       }).catch(function (error) {
         _this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
         _this.ttaskDetailLoading.splice(_this.ttaskDetailLoading.indexOf(_tindex), 1)
+        _this.isOutlineTaskCancelToken[index] = null
         console.log(error);
       });
       await _this.aiDetailgetAiContent(_uuid, _tindex, _tindex2)
     },
     aiDetailgetAiContent(_uid, loading, _tindex2) {
       // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
-      let _source = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
+      this.isOutlineTaskCancelSource[_tindex2] = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       // let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       let _allText = "";
       let _mdText = "";
       let _iindex = 0
-      _source.onmessage = _e => {
-        let _eData = JSON.parse(_e.data).content;
+      this.isOutlineTaskCancelSource[_tindex2].onmessage = _e => {
         if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
           //对话已经完成
           _mdText = _mdText.replace("_", "");
-          _source.close();
+          this.isOutlineTaskCancelSource[_tindex2].close();
+          this.isOutlineTaskCancelSource[_tindex2] = null;
           this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail2 = _mdText;
           this.taskDetailLoading.splice(this.taskDetailLoading.indexOf(loading), 1)
           this.ttaskDetailLoading.splice(this.ttaskDetailLoading.indexOf(loading), 1)
+          this.isOutlineTaskCancelToken[_tindex2] = null
           return;
         } else {
           _iindex++
@@ -19415,6 +19481,7 @@ ${msg}
           this.taskDetailLoading.splice(this.taskDetailLoading.indexOf(loading), 1)
           // 处理流数据
         }
+        
         // this.$forceUpdate();
       };
     },
@@ -19476,6 +19543,7 @@ ${target ? '课程目标:' + target.replaceAll('#','').replaceAll('*','').repl
 // - 补充描述:${_this.courseText2}
       _this.taskDetailLoading.push(_tindex)
       _this.ttaskDetailLoading.push(_tindex)
+      _this.isOutlineTaskCancelToken[index] = _this.ajax.setCancelSource();
       let _uuid = uuidv4();
       // let params = JSON.stringify({
       //   // "model": "Chat",
@@ -19532,11 +19600,12 @@ ${target ? '课程目标:' + target.replaceAll('#','').replaceAll('*','').repl
         } else {
           _this.$message.warning(response.data.FunctionResponse.result);
         }
-
+        _this.isOutlineTaskCancelToken[index] = null
         // _this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
       }).catch(function (error) {
         _this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
         _this.ttaskDetailLoading.splice(_this.ttaskDetailLoading.indexOf(_tindex), 1)
+        _this.isOutlineTaskCancelToken[index] = null
         console.log(error);
       });
       await _this.aiOutlineDetailgetAiContent(_uuid, _tindex, _tindex2)
@@ -19607,6 +19676,7 @@ ${taskArray.length ? '其他任务大纲名字:' + taskArray.join(',') : ''}
 // - 补充描述:${_this.courseText2}
       _this.taskDetailLoading.push(_tindex)
       _this.ttaskDetailLoading.push(_tindex)
+      _this.isOutlineTaskCancelToken[index] = _this.ajax.setCancelSource();
       let _uuid = uuidv4();
       // let params = JSON.stringify({
       //   // "model": "Chat",
@@ -19648,7 +19718,7 @@ ${taskArray.length ? '其他任务大纲名字:' + taskArray.join(',') : ''}
       //     model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
       // });
       // _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
-      _this.ajax.post('https://gpt4.cocorobo.cn/ai_agent_park_chat_new', params).then(function (response) {
+      _this.ajax.post('https://gpt4.cocorobo.cn/ai_agent_park_chat_new', params, _this.isOutlineTaskCancelToken[index]).then(function (response) {
       // _this.ajax.post('https://claude3.cocorobo.cn/chat', params).then(function (response) {
         console.log(response);
         // let data = response.data.FunctionResponse
@@ -19663,34 +19733,37 @@ ${taskArray.length ? '其他任务大纲名字:' + taskArray.join(',') : ''}
         } else {
           _this.$message.warning(response.data.FunctionResponse.result);
         }
-
+        _this.isOutlineTaskCancelToken[index] = null
         // _this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
       }).catch(function (error) {
         _this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
         _this.ttaskDetailLoading.splice(_this.ttaskDetailLoading.indexOf(_tindex), 1)
+        _this.isOutlineTaskCancelToken[index] = null
         console.log(error);
       });
       await _this.aiOutlineDetailgetAiContent(_uuid, _tindex, _tindex2)
     },
     aiOutlineDetailgetAiContent(_uid, loading, _tindex2) {
       // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
-      let _source = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
+      this.isOutlineTaskCancelSource[_tindex2] = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       // let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       let _allText = "";
       let _mdText = "";
       let _iindex = 0
-      _source.onmessage = _e => {
+      this.isOutlineTaskCancelSource[_tindex2].onmessage = _e => {
         let _eData = JSON.parse(_e.data).content;
         if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
           //对话已经完成
           _mdText = _mdText.replace("_", "");
-          _source.close();
+          this.isOutlineTaskCancelSource[_tindex2].close();
+          this.isOutlineTaskCancelSource[_tindex2] = null;
           this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail2 = _mdText;
           if(!this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail3 && this.isOutline2){
             this.aiDetail52(this.aiJson['teacherDetail2'], _tindex2)
           }
           this.taskDetailLoading.splice(this.taskDetailLoading.indexOf(loading), 1)
           this.ttaskDetailLoading.splice(this.ttaskDetailLoading.indexOf(loading), 1)
+          this.isOutlineTaskCancelToken[_tindex2] = null
           return;
         } else {
           _iindex++
@@ -19716,6 +19789,7 @@ ${taskArray.length ? '其他任务大纲名字:' + taskArray.join(',') : ''}
           }
           // 处理流数据
         }
+        
         // this.$forceUpdate();
       };
     },
@@ -20785,6 +20859,9 @@ ${this.teacherCourseText && this.aiCallBack == 2 ? '参考内容:'+this.teache
 ${msg}
 
 ${this.teacherCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内容>即可不用重新生成,让内容更具体化,更具体' : ''}`
+
+      _this.isTeacherTextCancelToken = _this.ajax.setCancelSource();
+
       let _uuid = uuidv4();
       // let params = JSON.stringify({
       //   // "model": "Chat",
@@ -20826,7 +20903,7 @@ ${this.teacherCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
       //     model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
       // });
       // _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
-      _this.ajax.post('https://gpt4.cocorobo.cn/ai_agent_park_chat_new', params).then(function (response) {
+      _this.ajax.post('https://gpt4.cocorobo.cn/ai_agent_park_chat_new', params, _this.isTeacherTextCancelToken).then(function (response) {
       // _this.ajax.post('https://claude3.cocorobo.cn/chat', params).then(function (response) {
         console.log(response);
         // let data = response.data.FunctionResponse
@@ -20837,31 +20914,34 @@ ${this.teacherCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
         } else {
           _this.$message.warning(response.data.FunctionResponse.result);
         }
-
+        _this.isTeacherTextCancelToken = null
       }).catch(function (error) {
         _this.teacherTextLoading = false
         _this.tteacherTextLoading = false
+        _this.isTeacherTextCancelToken = null
         console.log(error);
       });
       await _this.aiteacherTextDetailgetAiContent(_uuid)
     },
     aiteacherTextDetailgetAiContent(_uid) {
       // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
-      let _source = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
+      this.isTeacherTextCancelSource = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       // let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       let _allText = "";
       let _mdText = "";
       let _iindex = 0
-      _source.onmessage = _e => {
+      this.isTeacherTextCancelSource.onmessage = _e => {
         let _eData = JSON.parse(_e.data).content;
         if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
           //对话已经完成
           _mdText = _mdText.replace("_", "");
-          _source.close();
+          this.isTeacherTextCancelSource.close();
+          this.isTeacherTextCancelSource = null;
           this.teacherCourseText = _mdText;
           this.teacherTextLoading = false
           this.tteacherTextLoading = false
           this.teacherCourseTextB = false
+          this.isTeacherTextCancelToken = null
           return;
         } else {
           _iindex++
@@ -20887,6 +20967,7 @@ ${this.teacherCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
           }
           // 处理流数据
         }
+        
         // this.$forceUpdate();
       };
     },
@@ -20953,6 +21034,10 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '参考内容:'+this.targetC
 ${msg}
 
 ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参考内容>即可不用重新生成,让内容更具体化,更具体' : ''}`
+
+
+      _this.isTargetCancelToken1 = _this.ajax.setCancelSource();
+
       let _uuid = uuidv4();
       // let params = JSON.stringify({
       //   // "model": "Chat",
@@ -20994,7 +21079,7 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
       //     model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
       // });
       // _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
-      _this.ajax.post('https://gpt4.cocorobo.cn/ai_agent_park_chat_new', params).then(function (response) {
+      _this.ajax.post('https://gpt4.cocorobo.cn/ai_agent_park_chat_new', params, _this.isTargetCancelToken1).then(function (response) {
       // _this.ajax.post('https://claude3.cocorobo.cn/chat', params).then(function (response) {
         console.log(response);
         // let data = response.data.FunctionResponse
@@ -21005,31 +21090,34 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
         } else {
           _this.$message.warning(response.data.FunctionResponse.result);
         }
-
+        _this.isTargetCancelToken1 = null
       }).catch(function (error) {
         _this.targetTextLoading = false
         _this.ttargetTextLoading = false
+        _this.isTargetCancelToken1 = null
         console.log(error);
       });
       await _this.aitargetTextDetailgetAiContent(_uuid)
     },
     aitargetTextDetailgetAiContent(_uid) {
       // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
-      let _source = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
+      this.isTargetCancelSource1 = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       // let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       let _allText = "";
       let _mdText = "";
       let _iindex = 0
-      _source.onmessage = _e => {
+      this.isTargetCancelSource1.onmessage = _e => {
         let _eData = JSON.parse(_e.data).content;
         if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
           //对话已经完成
           _mdText = _mdText.replace("_", "");
-          _source.close();
+          this.isTargetCancelSource1.close();
+          this.isTargetCancelSource1 = null;
           this.targetCourseText = _mdText;
           this.targetTextLoading = false
           this.ttargetTextLoading = false
           this.targetCourseTextB = false
+          this.isTargetCancelToken1 = null
           return;
         } else {
           _iindex++
@@ -21055,6 +21143,7 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
           }
           // 处理流数据
         }
+        
         // this.$forceUpdate();
       };
     },
@@ -21352,21 +21441,23 @@ ${this.targetCourseText && this.aiCallBack == 2 ? '注意,优化原有的<参
     },
     aitargetTextDetail2getAiContent(_uid) {
       // let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
-      let _source = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
+      this.isTargetCancelSource2 = new EventSource(`https://gpt4.cocorobo.cn/question/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       // let _source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
       let _allText = "";
       let _mdText = "";
       let _iindex = 0
-      _source.onmessage = _e => {
+      this.isTargetCancelSource2.onmessage = _e => {
         let _eData = JSON.parse(_e.data).content;
         if (_eData.replace("'", "").replace("'", "") == "[DONE]") {
           //对话已经完成
           _mdText = _mdText.replace("_", "");
-          _source.close();
+          this.isTargetCancelSource2.close();
+          this.isTargetCancelSource2 = null;
           this.targetCourseText2 = _mdText;
           this.targetTextLoading2 = false
           this.ttargetTextLoading2 = false
           this.targetCourseText2B = false
+          this.isTargetCancelToken2 = null
           return;
         } else {
           _iindex++

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است