Sfoglia il codice sorgente

Changed on Login Stuff and visibility control.

jason.lu 6 anni fa
parent
commit
9cbc220ba9
2 ha cambiato i file con 23 aggiunte e 16 eliminazioni
  1. 1 1
      denglu.html
  2. 22 15
      js/entrance.js

+ 1 - 1
denglu.html

@@ -106,7 +106,7 @@
             <h5 class="card-header">
                 生产线 :
                 <select name="select" id="pro_areaCode">
-                    <option value="120000" selected="selected">生产拉线数据读取中</option>
+                    <option value="0" selected="selected">生产拉线数据读取中</option>
                 </select>
             </h5>
 

+ 22 - 15
js/entrance.js

@@ -4,26 +4,28 @@ var periodID = [];
 var periodname = [];
 var userId = utils_get_param("userId");
 
-
-if(userId == null){
+function getUserId() {
     var use = getCookie("doibyUser");
-    if(use == null){
-        // No Login
-        location.href="sign-in1.html?from=entrance-1";
-    }else{
-        userId = use;
+    if (use == null) {
+        location.href = "sign-in1.html?from=entrance-1&msg=nologin";
+        if (userId == null) {
+            userId = use;
+        } else {
+            // 指定新的userId
+            //userId = use;
+        }
     }
-}else{
-    // 没问题
-    // 是否存在
-    var use = getCookie("doibyUser");
-    if(use == null){
-        // No Login
-        location.href="sign-in1.html?from=entrance-2";
+    if(userId == null || userId === undefined){
+        location.href = "sign-in1.html?from=entrance-3&msg=userId-repeated-notdefined";
     }else{
+        if(parseInt(userId) <= 0){
+            location.href = "sign-in1.html?from=entrance-4";
+        }
     }
 }
 
+getUserId();
+
 function page_document_load() {
     new_data_group("denglu",function(gp){
         if(gp.counter === 2){
@@ -53,7 +55,7 @@ function first_success(obj, sta) {
             flowname[j] = output.list[i].flowName + "(负责人)";
             j++;
         } else {
-            flowID[j] = output.list[i].flowId;
+            flowID[j] = 0;
             flowname[j] = output.list[i].flowName + "(无权限)";
             j++;
             k++;
@@ -121,6 +123,11 @@ function getSpotHtml(htmlbody, i) {
 function moveToStart(btn) {
     $(btn).attr("disabled", "disabled");
     var proAreaCode = $("#pro_areaCode").val();
+    if(""+proAreaCode === "0"){
+        send_alert("请确认您拥有本产线的权限");
+        $(btn).attr("disabled","");
+        return;
+    }
     var periodnum = $("#period_ID").val();
     get_data("/fcWorkSchedule/startSchedule?flowId=" + proAreaCode + "&periodId=" + periodnum, startToSchedule);
 }