Browse Source

解决登陆问题

Limengbo 6 years ago
parent
commit
5dab68facf
1 changed files with 5 additions and 1 deletions
  1. 5 1
      utils/loginSchedule.js

+ 5 - 1
utils/loginSchedule.js

@@ -33,6 +33,7 @@ function wxLogin(successcallback, failcallback) {
 
 // 获取原来的 openid 和 session_key
 function getOpenidSessionKey(successcallback, failcallback, loginType) {
+    console.log('users......',wx.getStorageSync('user'))
   if (wx.getStorageSync('user')) {
     successcallback(
       wx.getStorageSync('user'),
@@ -140,8 +141,10 @@ function getLoginSchedule(sessionKey, openId, successcallback, failcallback, aff
                             iv: res.iv,
                             dist: '1133',
                             headimgurl: userInfo.avatarUrl,
-                            loginType
                         }          
+                        if(loginType != "") {
+                            userData.loginType = "1";
+                        }
                         request.getInstance().url(url).data(userData).method('GET').send().success(res => {
                             wx.hideToast()
                             wx.showToast({
@@ -149,6 +152,7 @@ function getLoginSchedule(sessionKey, openId, successcallback, failcallback, aff
                                 icon: 'success',
                                 duration: 1500
                             })
+                            console.log('users......',res)
                             wx.setStorageSync('uid', res.data.data.uid)
                             wx.setStorageSync('user', res)
                             successcallback(res)