...
|
...
|
@@ -74,18 +74,20 @@ export const getPhoneNumber = async (e) => { |
|
|
|
|
|
let userInfo = wx.getStorageSync('userInfo');
|
|
|
userInfo = Object.assign(userInfo, newUserInfo);
|
|
|
await setStorageWithValueForKey('userInfo', userInfo);
|
|
|
await setStorageWithValueForKey('sessionkey', result.session_key);
|
|
|
await setStorageValueForKey('userInfo', userInfo);
|
|
|
await setStorageValueForKey('sessionkey', bindResult.session_key);
|
|
|
|
|
|
app.globalData.userInfo = userInfo;
|
|
|
event.emit('wechat-login-success');
|
|
|
setTimeout(() => {
|
|
|
event.emit('wechat-login-success');
|
|
|
}, 1000);
|
|
|
event.emit('user-login-success', newUserInfo);
|
|
|
wx.showToast({
|
|
|
icon: 'none',
|
|
|
title: '手机号授权成功!\r\n为享受更多权益,已为您注册有货会员!',
|
|
|
duration: 3000
|
|
|
});
|
|
|
} else if (bindResult && bindResult.is_register === 2) {
|
|
|
} else if (bindResult && (bindResult.is_register === 2 || bindResult.is_register === 3 || bindResult.is_register === 4)) {
|
|
|
const newUserInfo = {
|
|
|
is_bind: bindResult.is_bind,
|
|
|
mobile: bindResult.profile,
|
...
|
...
|
@@ -98,8 +100,8 @@ export const getPhoneNumber = async (e) => { |
|
|
|
|
|
let userInfo = wx.getStorageSync('userInfo');
|
|
|
userInfo = Object.assign(userInfo, newUserInfo);
|
|
|
await setStorageWithValueForKey('userInfo', userInfo);
|
|
|
await setStorageWithValueForKey('sessionkey', result.session_key);
|
|
|
await setStorageValueForKey('userInfo', userInfo);
|
|
|
await setStorageValueForKey('sessionkey', bindResult.session_key);
|
|
|
|
|
|
app.globalData.userInfo = userInfo;
|
|
|
event.emit('wechat-login-success');
|
...
|
...
|
|