fix: keep tenant option list request

This commit is contained in:
richjohnrambo
2026-09-25 23:31:33 +08:00
parent 9e01f95a61
commit 0edbc63bc1
+7 -2
View File
@@ -32,8 +32,13 @@ export async function loadImTenantOptions(
// 登录用户已绑定商户租户:仅返回自己商户选项(与后端 resolveImAdminScope 强制范围一致)
if (boundTenantId > 0) {
const info = readCurrentUserInfo();
const tenant = { id: boundTenantId, name: info?.tenantName, code: info?.tenantCode };
target.value = [toTenantOption(tenant)];
try {
const res = await TenantList(params);
target.value = (res?.list || []).map(toTenantOption);
} catch {
const tenant = { id: boundTenantId, name: info?.tenantName, code: info?.tenantCode };
target.value = [toTenantOption(tenant)];
}
return target.value;
}