浏览代码

Changed on Login Stuff and visibility control.

jason.lu 6 年之前
父节点
当前提交
09212665d7
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      js/basic.js

+ 5 - 4
js/basic.js

@@ -374,25 +374,26 @@ function getCookie(c_name)
 var userId = utils_get_param("userId");
 
 function getUserId() {
+    console.log("Original  USERID : " + userId);
     var use = getCookie("doibyUser");
     if (use == null || use === undefined || use.length <= 0) {
         location.href = "sign-in1.html?from=entrance-1&msg=nologin-mustauth";
         return;
     }
-
+    console.log("Got UID From COOKIE : " + use);
     try{
         var mm = parseInt(use);
         if(mm <= 0){
             location.href = "sign-in1.html?from=entrance-1&msg=cookie-wrong-format";
+        }else{
+            userId = mm;
         }
     }catch (e) {
         location.href = "sign-in1.html?from=entrance-1&msg=cookie-wrong-format";
         return;
     }
 
-    if(userId == null || userId === undefined){
-        userId = parseInt(use);
-    }
+    console.log("Got UserId Eventually : " + userId);
 }