Browse Source

fix(Student): 修复作业提交时未重置提交状态的问题

在iframe提交、文件上传和截图提交失败时,添加对isSubmitting状态的重置,防止界面卡在提交中状态
lsc 2 months ago
parent
commit
a2c18e2904
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/views/Student/index.vue

+ 4 - 0
src/views/Student/index.vue

@@ -1709,10 +1709,12 @@ const handleHomeworkSubmit = async () => {
           } 
           else {
             console.log('iframe中没有找到submitWork方法')
+            isSubmitting.value = false
           }
         } 
         catch (error) {
           console.error('访问iframe内容时出错:', error)
+          isSubmitting.value = false
         }
       } 
       else if (iframeSrc && (iframeSrc.includes('aichat.cocorobo') || iframeSrc.includes('knowledge.cocorobo'))) {
@@ -1747,6 +1749,7 @@ const handleHomeworkSubmit = async () => {
           }
           catch (error) {
             console.error('文件上传失败:', error)
+            isSubmitting.value = false
             message.error('作业提交失败,请重试')
           }
         }
@@ -1951,6 +1954,7 @@ const handleHomeworkSubmit = async () => {
         }
         catch (error) {
           console.error('截图提交失败:', error)
+          isSubmitting.value = false
           message.error('截图提交失败')
         }
       }