瀏覽代碼

1.增加点击跳转到登录页面

kwonghinho 7 年之前
父節點
當前提交
6995fa4195
共有 1 個文件被更改,包括 14 次插入0 次删除
  1. 14 0
      wx.demo.ywtinfo.com/js/index.min.js

+ 14 - 0
wx.demo.ywtinfo.com/js/index.min.js

@@ -5,6 +5,12 @@
     var b = {idx: [1, 6, 7, 8], count: 2, current: 1};
     icoNavFx.doing(c("#nav_bottom"), b);
     c(".login_open").on("touchend", function (d) {
+        var token = window.hzAPI.getToken().token;//token
+        //判断token是否存在
+        if(!token){
+            window.location.href = 'login.html';
+            e.preventDefault();
+        }
         if (c("#container").hasClass("push") == false) {
             if (a == 0) {
                 c("#container,#user,#header,#nav_bottom").addClass("pull");
@@ -38,5 +44,13 @@
                 c(".reset_input").removeClass("ton").hide()
             }
         }
+    });
+    c("a").on("click",function (e) {
+        var token = window.hzAPI.getToken().token;//token
+        //判断token是否存在
+        if(!token){
+            window.location.href = 'login.html';
+            e.preventDefault();
+        }
     })
 })(Zepto);