Browse Source

feature: 处理判断登录方式异常问题

Damon 8 tháng trước cách đây
mục cha
commit
c17168788e
1 tập tin đã thay đổi với 7 bổ sung2 xóa
  1. 7 2
      pages/index/index.js

+ 7 - 2
pages/index/index.js

@@ -19,6 +19,7 @@ Page({
   data: {
     ///下午好
     greeting: "",
+    phone: "",
     nvabarData: {
       showCapsule: 0, //是否显示左上角图标   1表示显示    0表示不显示
       title: 'OhPlay', //导航栏 中间的标题
@@ -152,7 +153,8 @@ Page({
     wx.getStorage({
       key: "userInfo",
       success(res) {
-        if (!res.data.phone) {
+        var phone = res.data.phone;
+        if (!phone) {
           return;
         };
 
@@ -163,6 +165,7 @@ Page({
         }
 
         that.setData({
+          phone: phone,
           greeting: greeting,
           nickname: nickname,
           userPic: res.data.headUrl || "",
@@ -663,6 +666,7 @@ Page({
             greeting = greeting + ',' + nickname;;
           }
           that.setData({
+            phone: "",
             greeting: greeting,
             islogin: false,
             nickname: nickname,
@@ -686,8 +690,9 @@ Page({
 
   addDevice() {
     var that = this;
+    var phone = that.data.phone;
     var showLogin = that.data.showLogin;
-    if (showLogin) {
+    if (phone == "" || showLogin) {
       wx.navigateTo({
         url: './../login/login'
       });