fix: 问题修复
This commit is contained in:
parent
c54d44b57e
commit
ad6b3f208c
@ -94,7 +94,7 @@ async function changeTeam({ teamId, corpId, corpUserId, externalUserId, qrid, re
|
||||
qrid,
|
||||
referenceCustomerId: referenceCustomerId || ''
|
||||
});
|
||||
await login()
|
||||
await login('', { forceVerify: true })
|
||||
if (account.value && account.value.mobile) {
|
||||
bindTeam({ corpUserId, externalUserId })
|
||||
} else {
|
||||
|
||||
@ -26,7 +26,7 @@ export default defineStore("accountStore", () => {
|
||||
|
||||
async function login(phoneCode = '', options = {}) {
|
||||
if (loading.value) return;
|
||||
if (account.value && account.value.mobile) {
|
||||
if (account.value && account.value.mobile && !options.forceVerify) {
|
||||
return account.value
|
||||
}
|
||||
loading.value = true;
|
||||
@ -54,6 +54,12 @@ export default defineStore("accountStore", () => {
|
||||
|
||||
// initIMAfterLogin(openid.value)
|
||||
return normalizedAccount
|
||||
} else {
|
||||
account.value = null;
|
||||
openid.value = '';
|
||||
uni.removeStorageSync('account');
|
||||
uni.removeStorageSync('openid');
|
||||
return
|
||||
}
|
||||
}
|
||||
if (!options.silent) toast('登录失败,请重新登录');
|
||||
@ -154,9 +160,9 @@ export default defineStore("accountStore", () => {
|
||||
const unionid = account.value?.unionid;
|
||||
const openid = account.value?.openid;
|
||||
if (!(normalizedCorpId && unionid && openid)) {
|
||||
externalUserId.value = '';
|
||||
return
|
||||
};
|
||||
externalUserId.value = '';
|
||||
return
|
||||
};
|
||||
const res = await api('getUnionidToExternalUserid', { unionid, openid, corpId: normalizedCorpId }, false);
|
||||
const id = res && res.success && typeof res.data === 'string' && res.data.trim() ? res.data.trim() : '';
|
||||
externalUserId.value = id;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user