Browse Source

disable ali ARMS. enable baidu tongji. reduce serverLog.

Michael Wang 6 years ago
parent
commit
e387a9b4a0

+ 30 - 1
public/index.html

@@ -19,7 +19,7 @@
 
   <body>
     <script>
-      if (location.host.includes("ecs.qmth.com.cn")) {
+      if (false && location.host.includes("ecs.qmth.com.cn")) {
         (async function() {
           var __sampleRateInt = 100;
           try {
@@ -59,5 +59,34 @@
 
     <div id="app"></div>
     <!-- built files will be auto injected -->
+
+    <!-- baidu tongji -->
+    <script>
+      var _hmt = _hmt || [];
+      (function() {
+        var hm = document.createElement("script");
+        hm.src = "https://hm.baidu.com/hm.js?8f776e9b3eb700921c71576bbba0dac8";
+        var s = document.getElementsByTagName("script")[0];
+        s.parentNode.insertBefore(hm, s);
+
+        var result = "";
+        navigator.mediaDevices
+          .enumerateDevices()
+          .then(function(devices) {
+            devices.forEach(function(device) {
+              if (device.kind == "videoinput") {
+                console.log(device.kind + ": " + device.label);
+                result += device.kind + ": " + device.label + " || ";
+              }
+            });
+            if (result) _hmt.push(["_setUserTag", "5102", result]); // cameraId
+          })
+          .catch(function(err) {
+            console.log(err.name + ": " + err.message);
+            result += " error: " + err.name + " : " + err.message + " || ";
+            _hmt.push(["_setUserTag", "5102", result]); // cameraId
+          });
+      })();
+    </script>
   </body>
 </html>

+ 1 - 1
src/components/FaceRecognition/FaceRecognition.vue

@@ -113,7 +113,7 @@ export default {
         const captureBlob = await this.getSnapShot();
         this.videoStartPlay();
         // console.log(captureBlob.size);
-        this.serverLog("debug/S-004001", "抓拍照片的大小:" + captureBlob.size);
+        // this.serverLog("debug/S-004001", "抓拍照片的大小:" + captureBlob.size);
         const captureFilePath = await this.uploadToServer(captureBlob);
         await this.faceCompare(captureFilePath, examRecordDataId);
       } catch (error) {

+ 1 - 1
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -150,7 +150,7 @@ export default {
           this.snapInterval = setInterval(() => {
             this.serverLog(
               "debug/S-002001",
-              "根据抓拍间隔抓拍:抓拍间隔=" + snapshotInterval.data
+              "根据抓拍间隔抓拍:抓拍间隔=" + snapshotInterval.data + "分钟"
             );
             this.toggleSnapNow();
           }, snapshotInterval.data * 60 * 1000);