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