|
@@ -74,18 +74,20 @@ export const getPhoneNumber = async (e) => { |
|
@@ -74,18 +74,20 @@ export const getPhoneNumber = async (e) => { |
74
|
|
74
|
|
75
|
let userInfo = wx.getStorageSync('userInfo');
|
75
|
let userInfo = wx.getStorageSync('userInfo');
|
76
|
userInfo = Object.assign(userInfo, newUserInfo);
|
76
|
userInfo = Object.assign(userInfo, newUserInfo);
|
77
|
- await setStorageWithValueForKey('userInfo', userInfo);
|
|
|
78
|
- await setStorageWithValueForKey('sessionkey', result.session_key);
|
77
|
+ await setStorageValueForKey('userInfo', userInfo);
|
|
|
78
|
+ await setStorageValueForKey('sessionkey', bindResult.session_key);
|
79
|
|
79
|
|
80
|
app.globalData.userInfo = userInfo;
|
80
|
app.globalData.userInfo = userInfo;
|
81
|
- event.emit('wechat-login-success');
|
81
|
+ setTimeout(() => {
|
|
|
82
|
+ event.emit('wechat-login-success');
|
|
|
83
|
+ }, 1000);
|
82
|
event.emit('user-login-success', newUserInfo);
|
84
|
event.emit('user-login-success', newUserInfo);
|
83
|
wx.showToast({
|
85
|
wx.showToast({
|
84
|
icon: 'none',
|
86
|
icon: 'none',
|
85
|
title: '手机号授权成功!\r\n为享受更多权益,已为您注册有货会员!',
|
87
|
title: '手机号授权成功!\r\n为享受更多权益,已为您注册有货会员!',
|
86
|
duration: 3000
|
88
|
duration: 3000
|
87
|
});
|
89
|
});
|
88
|
- } else if (bindResult && bindResult.is_register === 2) {
|
90
|
+ } else if (bindResult && (bindResult.is_register === 2 || bindResult.is_register === 3 || bindResult.is_register === 4)) {
|
89
|
const newUserInfo = {
|
91
|
const newUserInfo = {
|
90
|
is_bind: bindResult.is_bind,
|
92
|
is_bind: bindResult.is_bind,
|
91
|
mobile: bindResult.profile,
|
93
|
mobile: bindResult.profile,
|
|
@@ -98,8 +100,8 @@ export const getPhoneNumber = async (e) => { |
|
@@ -98,8 +100,8 @@ export const getPhoneNumber = async (e) => { |
98
|
|
100
|
|
99
|
let userInfo = wx.getStorageSync('userInfo');
|
101
|
let userInfo = wx.getStorageSync('userInfo');
|
100
|
userInfo = Object.assign(userInfo, newUserInfo);
|
102
|
userInfo = Object.assign(userInfo, newUserInfo);
|
101
|
- await setStorageWithValueForKey('userInfo', userInfo);
|
|
|
102
|
- await setStorageWithValueForKey('sessionkey', result.session_key);
|
103
|
+ await setStorageValueForKey('userInfo', userInfo);
|
|
|
104
|
+ await setStorageValueForKey('sessionkey', bindResult.session_key);
|
103
|
|
105
|
|
104
|
app.globalData.userInfo = userInfo;
|
106
|
app.globalData.userInfo = userInfo;
|
105
|
event.emit('wechat-login-success');
|
107
|
event.emit('wechat-login-success');
|