Authored by QC-L

修改注册成功后的逻辑判断 review by 黄敬囿

1 -const app_version = '0.2.0' 1 +const app_version = '1.0.0'
2 const private_key = 'b43890b0a296ff3c7b8c260ca763980b' 2 const private_key = 'b43890b0a296ff3c7b8c260ca763980b'
3 const appid = 'wxc677c88385762287' 3 const appid = 'wxc677c88385762287'
4 export default { 4 export default {
@@ -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);