zjh 5 years ago
parent
commit
5b5ee53a74
2 changed files with 10 additions and 3 deletions
  1. 9 2
      pages/auth/auth.js
  2. 1 1
      pages/item/item.js

+ 9 - 2
pages/auth/auth.js

@@ -13,9 +13,16 @@ Page({
     wx.getSetting({
       success: (res) => {
         if (res.authSetting['scope.userInfo']) {
-          wx.reLaunch({
-            url: '/pages/index/index',
+          // app.globalData.userInfo = res.userInfo
+          wx.getUserInfo({
+            success: res => {
+             app.globalData.userInfo = res.userInfo
+              wx.reLaunch({
+                url: '/pages/index/index',
+              })
+            }
           })
+
         }
       }
     })

+ 1 - 1
pages/item/item.js

@@ -374,7 +374,7 @@ Page({
     })
   that.posthisfind(JSON.parse(options.row).industryId,)
   that.postpredfind(JSON.parse(options.row).industryId,)
-
+  console.log(app.globalData.userInfo)
   },
   postfollow:function(){
     var that = this;