Browse Source

没有userId返回主页

Reiskuchen 5 năm trước cách đây
mục cha
commit
bfa495ebb5

+ 2 - 1
minigame/WebContent/lottery.html

@@ -26,7 +26,7 @@
             //id设置进入localstorage
             localStorage.setItem("userId", id);
             //在这里查看是否有id
-            if(id == null){
+            if(id == null || id == undefined || id == ""){
             	window.location.href = "http://wx.ttkuaiban.com/minigame";
             }
             
@@ -61,6 +61,7 @@
                             //设置要中奖的位置 1.5没有 0十二瓶 4一升 2.6五百毫升 3书 7肥皂
                             if(resp.data.prizeLevel == -1){
                             	var rand = Math.round(Math.random()*2);
+                            	console.log(rand);
                             	if(rand <= 1){
                             		threshold = 1;
                             	}else{

+ 1 - 1
minigame/WebContent/static/lottery.html

@@ -26,7 +26,7 @@
             //id设置进入localstorage
             localStorage.setItem("userId", id);
             //在这里查看是否有id
-            if(id == null){
+            if(id == null || id == undefined || id == ""){
             	window.location.href = "http://wx.ttkuaiban.com/minigame";
             }