...
|
...
|
@@ -54,6 +54,7 @@ const handleLoginData = (loginData) => { |
|
|
*/
|
|
|
export const decodeUnionId = (srd_session, result) => {
|
|
|
let res = result.detail;
|
|
|
let fromPage = result.currentTarget.dataset.from;
|
|
|
let globalData = getGlobalData();
|
|
|
// 存储 userInfo
|
|
|
if (res && res.userInfo) {
|
...
|
...
|
@@ -75,7 +76,6 @@ export const decodeUnionId = (srd_session, result) => { |
|
|
} else {
|
|
|
union_id = globalData.union_id;
|
|
|
}
|
|
|
|
|
|
if (!union_id) {
|
|
|
throw new Error('union_id is null');
|
|
|
}
|
...
|
...
|
@@ -184,8 +184,8 @@ export const getUserInfo = (e) => { |
|
|
return;
|
|
|
}
|
|
|
decodeUnionId(loginData.srd_session, e).then(data => {
|
|
|
if (!data.union_id) throw new Error('union_id is null');
|
|
|
wechatUserIsBind(data.union_id, data.userInfo).then(message => {
|
|
|
|
|
|
if (message.code === 10003) {
|
|
|
event.emit(checkEventName(USER_LOGIN_SUCCESS, fromPage));
|
|
|
setTimeout(() => {
|
...
|
...
|
@@ -209,12 +209,12 @@ export const getUserInfo = (e) => { |
|
|
}
|
|
|
event.emit(checkEventName(USER_LOGIN_CALLBACK, fromPage), message);
|
|
|
}).catch(error => {
|
|
|
console.log(error);
|
|
|
event.emit(checkEventName(USER_LOGIN_CALLBACK, fromPage), error);
|
|
|
event.emit(checkEventName(USER_GET_PHONENUMBER_ERROR, fromPage), error.message);
|
|
|
});
|
|
|
}).catch(error => {
|
|
|
console.log(error);
|
|
|
event.emit(checkEventName(USER_LOGIN_CALLBACK, fromPage), error);
|
|
|
event.emit(checkEventName(USER_GET_PHONENUMBER_ERROR, fromPage), error.message);
|
|
|
});
|
|
|
});
|
|
|
} else {
|
...
|
...
|
|