lsc 2 lat temu
rodzic
commit
028b5ae7d8
1 zmienionych plików z 24 dodań i 5 usunięć
  1. 24 5
      src/common/jietu2.js

+ 24 - 5
src/common/jietu2.js

@@ -104,7 +104,7 @@ function addSWork_shishi(uid, cid, stage, task, tool, a, loading) {
     url: 'https://pbl.cocorobo.cn/api/pbl/addCourseWorks2',
     data: params,
     dataType: "json",
-    success: (data) => {
+    error: (XMLHttpRequest, textStatus, errorThrown) => {
       var _a = document.getElementsByTagName("img")
       for (var i = 0; i < _a.length; i++) {
         _a[i].removeAttribute("crossorigin")
@@ -114,14 +114,33 @@ function addSWork_shishi(uid, cid, stage, task, tool, a, loading) {
       _div.style = "width:100%;height:100%;background:#0000008f;position:fixed;top:0;left:0;z-index:99999999999999;display: flex;justify-content: center;align-items: center;"
       let _inner = document.createElement('div')
       _inner.style = "color: #fff;padding: 15px;background: #00000070;border-radius: 5px;font-size: 18px;"
-      _inner.innerHTML = "截图上传成功"
+      _inner.innerHTML = "上传失败,网络错误终端"
       _div.appendChild(_inner)
       document.body.appendChild(_div)
       setTimeout(() => {
-        //  document.body.removeChild(_loading)
         document.body.removeChild(_div)
-      }, 2000);
-      console.log("截图上传成功");
+      }, 1000);
+    },
+    success: (data) => {
+      setTimeout(() =>{
+        var _a = document.getElementsByTagName("img")
+        for (var i = 0; i < _a.length; i++) {
+          _a[i].removeAttribute("crossorigin")
+        }
+        top.document.getElementById(loading).children[0].style.display = "none"
+        let _div = document.createElement('div')
+        _div.style = "width:100%;height:100%;background:#0000008f;position:fixed;top:0;left:0;z-index:99999999999999;display: flex;justify-content: center;align-items: center;"
+        let _inner = document.createElement('div')
+        _inner.style = "color: #fff;padding: 15px;background: #00000070;border-radius: 5px;font-size: 18px;"
+        _inner.innerHTML = "截图上传成功"
+        _div.appendChild(_inner)
+        document.body.appendChild(_div)
+        setTimeout(() => {
+          //  document.body.removeChild(_loading)
+          document.body.removeChild(_div)
+        }, 1000);
+        console.log("截图上传成功");
+      },3000)
     }
   })
 }