lsc 6 dni temu
rodzic
commit
78b443f6a5
2 zmienionych plików z 38 dodań i 3 usunięć
  1. 5 2
      js/Desktop/Onload.js
  2. 33 1
      js/liyuan/Onload2.js

+ 5 - 2
js/Desktop/Onload.js

@@ -777,8 +777,11 @@ U.MD.D.getuser2 = function (userid, cid) {
                         U.MD.D.I.openApplication("studentStudy")
                     }
                     U.MD.O.P.connect(); //登录成功后连接socket服务同步协同编辑
-                    U.MD.D.I.openInApplication("studyDetail", cid, 2, 2)
-                    U.MD.D.addOp3("1", "", { type: "user_login_inviteCode" }, "success")
+
+                    if(cid){
+                        U.MD.D.I.openInApplication("studyDetail", cid, 2, 2)
+                        U.MD.D.addOp3("1", "", { type: "user_login_inviteCode" }, "success")
+                    }
                 });
             }
             

+ 33 - 1
js/liyuan/Onload2.js

@@ -774,7 +774,11 @@ U.MD.D.getuser2 = function (userid, cid) {
                         U.MD.D.I.openApplication("studentStudy")
                     }
                     U.MD.O.P.connect(); //登录成功后连接socket服务同步协同编辑
-                    U.MD.D.I.openInApplication("studyDetail", cid, 2, 2)
+                    
+                    if(cid){
+                        U.MD.D.I.openInApplication("studyDetail", cid, 2, 2)
+                        U.MD.D.addOp3("1", "", { type: "user_login_inviteCode" }, "success")
+                    }
                 });
             }
             
@@ -1255,3 +1259,31 @@ function addOp(text,type,time){
         }, [], { "type": "POST", "withCredentials": true });
     }
 }
+
+U.MD.D.addOp3 = async (userTime, loadTime, object, status) => {
+    let browser = detectBrowser()
+    let _time = new Date().toLocaleString('zh-CN', { hour12: false, timeZone: 'Asia/Shanghai' }).replace(/\//g, '-');
+    let params = {
+        userid: US.userInfo.userid,
+        username: US.userInfo.name,
+        accountNumber: US.userInfo.accountNumber,
+        org: US.userInfo.orgName,
+        school: US.userInfo.schoolName,
+        role: US.userInfo.type == '1' ? '老师' : '学生',
+        browser: browser,
+        userTime: userTime == '1' ? _time : userTime, // 使用时间 1次的就1 其次传秒
+        loadTime: loadTime, //load的时间没有就“”
+        object: JSON.stringify(object), //执行信息传json
+        status: status, //成功返回success。失败返回error的信息
+    }
+    fetch("https://pbl.cocorobo.cn/api/mongo/updateUserData2P", { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(params) }).then(res => {
+        if (res.status == 200) {
+            console.log('保存成功')
+        } else {
+            console.log('保存失败')
+        }
+    }).catch(e => {
+        console.log('保存失败')
+        console.log(e);
+    })
+}