diff --git a/store/account.js b/store/account.js index e567b5b..ef4fa29 100644 --- a/store/account.js +++ b/store/account.js @@ -141,7 +141,10 @@ export default defineStore("accountStore", () => { async function getExternalUserId(corpId) { const unionid = account.value?.unionid; const openid = account.value?.openid; - if (!(corpId && unionid && openid)) return; + if (!(corpId && unionid && openid)) { + externalUserId.value = ''; + return + }; const res = await api('getUnionidToExternalUserid', { unionid, openid, corpId }, false); const id = res && res.success && typeof res.data === 'string' && res.data.trim() ? res.data.trim() : ''; externalUserId.value = id;