修改注册成功后的逻辑判断 review by 黄敬囿
Showing
2 changed files
with
21 additions
and
1 deletions
@@ -309,6 +309,26 @@ export const getPhoneNumber = (e) => { | @@ -309,6 +309,26 @@ export const getPhoneNumber = (e) => { | ||
309 | title: '手机号授权成功!\r\n为享受更多权益,已为您注册有货会员!', | 309 | title: '手机号授权成功!\r\n为享受更多权益,已为您注册有货会员!', |
310 | duration: 3000 | 310 | duration: 3000 |
311 | }); | 311 | }); |
312 | + } else { | ||
313 | + const newUserInfo = { | ||
314 | + is_bind: result.is_bind, | ||
315 | + mobile: result.profile, | ||
316 | + session_key: result.session_key, | ||
317 | + uid: result.uid, | ||
318 | + ssouid: result.ssouid, | ||
319 | + union_id: union_id, | ||
320 | + vip: result.vip | ||
321 | + }; | ||
322 | + | ||
323 | + let userInfo = wx.getStorageSync('userInfo'); | ||
324 | + userInfo = Object.assign(userInfo, newUserInfo); | ||
325 | + setStorageWithValueForKey('userInfo', userInfo); | ||
326 | + setStorageWithValueForKey('session_key', result.session_key); | ||
327 | + globalData.userInfo = userInfo; | ||
328 | + event.emit(checkEventName(USER_LOGIN_SUCCESS, fromPage)); | ||
329 | + setTimeout(() => { | ||
330 | + event.emit(MY_USER_LOGIN_SUCCESS); | ||
331 | + }, 1000); | ||
312 | } | 332 | } |
313 | }).catch(error => { | 333 | }).catch(error => { |
314 | event.emit(checkEventName(USER_GET_PHONENUMBER_ERROR, fromPage), error.message); | 334 | event.emit(checkEventName(USER_GET_PHONENUMBER_ERROR, fromPage), error.message); |
-
Please register or login to post a comment