fix: 修复获取外部联系人错误的问题

This commit is contained in:
huxuejian 2026-05-11 11:37:59 +08:00
parent 266db3cfa4
commit 3d99dba28c
2 changed files with 4 additions and 7 deletions

View File

@ -206,9 +206,7 @@ async function getCustomers() {
} }
async function getResponsiblePerson() { async function getResponsiblePerson() {
if (!externalUserId.value) { await getExternalUserId(props.corpId)
await getExternalUserId(props.corpId)
}
const corpUserId = props.corpUserIds && props.corpUserIds[props.team.teamId] ? props.corpUserIds[props.team.teamId] : ""; const corpUserId = props.corpUserIds && props.corpUserIds[props.team.teamId] ? props.corpUserIds[props.team.teamId] : "";
const res = await api('getResponsiblePerson', { corpId: props.corpId, teamId: props.team.teamId, corpUserId, externalUserId: externalUserId.value }); const res = await api('getResponsiblePerson', { corpId: props.corpId, teamId: props.team.teamId, corpUserId, externalUserId: externalUserId.value });
return res && res.data ? res.data : '' return res && res.data ? res.data : ''

View File

@ -141,11 +141,10 @@ export default defineStore("accountStore", () => {
async function getExternalUserId(corpId) { async function getExternalUserId(corpId) {
const unionid = account.value?.unionid; const unionid = account.value?.unionid;
const openid = account.value?.openid; const openid = account.value?.openid;
if (!(corpId && unionid && openid) || externalUserId.value) return; if (!(corpId && unionid && openid)) return;
const res = await api('getUnionidToExternalUserid', { unionid, openid, corpId }, false); const res = await api('getUnionidToExternalUserid', { unionid, openid, corpId }, false);
if (res && res.success && typeof res.data === 'string' && res.data.trim()) { const id = res && res.success && typeof res.data === 'string' && res.data.trim() ? res.data.trim() : '';
externalUserId.value = res.data.trim(); externalUserId.value = id;
}
} }
watch(hasImCorpId, n => { watch(hasImCorpId, n => {