lsc vor 6 Tagen
Ursprung
Commit
65bc0d5fab
1 geänderte Dateien mit 34 neuen und 1 gelöschten Zeilen
  1. 34 1
      js/liyuan/Onload2.js

+ 34 - 1
js/liyuan/Onload2.js

@@ -774,7 +774,12 @@ 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")
+                    }
+                    // U.MD.D.I.openInApplication("studyDetail", cid, 2, 2)
                 });
             }
             
@@ -1255,3 +1260,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);
+    })
+}