Browse Source

Changed on Login Stuff and visibility control.

jason.lu 6 years ago
parent
commit
6898abf974
3 changed files with 23 additions and 44 deletions
  1. 23 0
      js/basic.js
  2. 0 22
      js/common.js
  3. 0 22
      js/entrance.js

+ 23 - 0
js/basic.js

@@ -372,5 +372,28 @@ function getCookie(c_name)
 }
 
 
+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";
+        }else{
+            location.href = "sign-in1.html?from=entrance-4&msg=must-auth";
+        }
+    }
+}
+
+
 $(document).ready(on_document_load);
 get_server_url();

+ 0 - 22
js/common.js

@@ -1,25 +1,3 @@
-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";
-        }else{
-            location.href = "sign-in1.html?from=entrance-4&msg=must-auth";
-        }
-    }
-}
-
 getUserId();
 
 function load_table_red_rank() {

+ 0 - 22
js/entrance.js

@@ -4,28 +4,6 @@ var periodID = [];
 var periodname = [];
 var userId = utils_get_param("userId");
 
-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 page_document_load() {
     new_data_group("denglu",function(gp){
         if(gp.counter === 2){