Browse Source

Changed on Login Stuff and visibility control.

jason.lu 6 years ago
parent
commit
36d3c72836
2 changed files with 24 additions and 2 deletions
  1. 2 2
      denglu.html
  2. 22 0
      js/common.js

+ 2 - 2
denglu.html

@@ -104,7 +104,7 @@
         </div>
         <div class="card">
             <h5 class="card-header">
-                生产线 :
+                生产线模式 :
                 <select name="select" id="pro_areaCode">
                     <option value="0" selected="selected">生产拉线数据读取中</option>
                 </select>
@@ -124,7 +124,7 @@
         <div class="card">
             <h5 class="card-header">大屏模式</h5>
             <div class="card-body">
-                <h5 class="card-title">您可以看到生产线内部的实时状况</h5>
+                <h5 class="card-title">您可以看到全厂实时状况</h5>
                 <p class="card-text">点击下面按钮,打开大屏幕</p>
                 <a href="#" class="btn btn-primary" onclick="location.href='dapingmu.html'">前往大屏幕</a>
             </div>

+ 22 - 0
js/common.js

@@ -1,3 +1,25 @@
+function getUserId() {
+    var use = getCookie("doibyUser");
+    if (use == null) {
+        location.href = "sign-in1.html?from=entrance-1&msg=nologin";
+        if (userId == null) {
+            userId = use;
+        } else {
+            // 指定新的userId
+            //userId = use;
+        }
+    }
+    if(userId == null || userId === undefined){
+        location.href = "sign-in1.html?from=entrance-3&msg=from-cookie-userId-repeated-notdefined";
+    }else{
+        if(parseInt(userId) <= 0){
+            location.href = "sign-in1.html?from=entrance-4&msg=from-cookie-parseOut0";
+        }
+    }
+}
+
+getUserId();
+
 function load_table_red_rank() {
     get_data("fcBiWorkerDaily/get?type=1&limit=3", on_red_rank_success);
 }