Authored by QC-L

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

const app_version = '0.2.0'
const app_version = '1.0.0'
const private_key = 'b43890b0a296ff3c7b8c260ca763980b'
const appid = 'wxc677c88385762287'
export default {
... ...
... ... @@ -309,6 +309,26 @@ export const getPhoneNumber = (e) => {
title: '手机号授权成功!\r\n为享受更多权益,已为您注册有货会员!',
duration: 3000
});
} else {
const newUserInfo = {
is_bind: result.is_bind,
mobile: result.profile,
session_key: result.session_key,
uid: result.uid,
ssouid: result.ssouid,
union_id: union_id,
vip: result.vip
};
let userInfo = wx.getStorageSync('userInfo');
userInfo = Object.assign(userInfo, newUserInfo);
setStorageWithValueForKey('userInfo', userInfo);
setStorageWithValueForKey('session_key', result.session_key);
globalData.userInfo = userInfo;
event.emit(checkEventName(USER_LOGIN_SUCCESS, fromPage));
setTimeout(() => {
event.emit(MY_USER_LOGIN_SUCCESS);
}, 1000);
}
}).catch(error => {
event.emit(checkEventName(USER_GET_PHONENUMBER_ERROR, fromPage), error.message);
... ...