Browse Source

联调登录

Limengbo 5 years ago
parent
commit
448b1312cc
1 changed files with 8 additions and 9 deletions
  1. 8 9
      view/question.html

+ 8 - 9
view/question.html

@@ -69,16 +69,15 @@
 //console.log(localStorage.getItem('userData') == 'undefined')
 window.onload=function(){
     // if(localStorage.getItem('userData') == 'undefined') {
-    //     alert('请重新扫码登陆')
-    //     window.location.href = '../index.html'
-    //     return false;
-    // }
+        alert('请重新扫码登陆')
+        window.location.href = '../index.html'
+        return false;
+    }
 
-    // var user = JSON.parse(localStorage.getItem('userData'));
-    // var uid = user.uid;
-    // var avatar = user.avatar ? user.avatar : '';
-    // var name = user.wechatName ? user.wechatName : '小朋友';
-    var uid = 36;
+    var user = JSON.parse(localStorage.getItem('userData'));
+    var uid = user.uid;
+    var avatar = user.avatar ? user.avatar : '';
+    var name = user.wechatName ? user.wechatName : '小朋友';
     //获取Canvas对象(画布)
     var canvas = document.getElementById("myCanvas");
     var data = {