Browse Source
Merge pull request #1155 from colinin/feat-login
feat: 租户cookie改为store
pull/1162/head
yx lin
12 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
1 additions and
2 deletions
-
apps/vben5/packages/@abp/saas/src/components/tenants/TenantSelect.vue
-
apps/vben5/packages/@abp/saas/src/components/tenants/TenantSelectModal.vue
|
|
|
@ -34,6 +34,7 @@ function onSwitchClick() { |
|
|
|
} |
|
|
|
|
|
|
|
function onChange(tenant?: { id?: string; name?: string }) { |
|
|
|
abpStore.setTenantId(tenant?.id); |
|
|
|
emits('change', tenant); |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
@ -53,7 +53,6 @@ async function onSubmit(values: Record<string, any>) { |
|
|
|
modalApi.setState({ submitting: true }); |
|
|
|
try { |
|
|
|
tenant.value = undefined; |
|
|
|
localStorage.removeItem('__tenant'); |
|
|
|
if (values.name) { |
|
|
|
const result = await findTenantByNameApi(values.name); |
|
|
|
if (!result.success) { |
|
|
|
@ -69,7 +68,6 @@ async function onSubmit(values: Record<string, any>) { |
|
|
|
return; |
|
|
|
} |
|
|
|
tenant.value = { id: result.tenantId, name: result.normalizedName }; |
|
|
|
localStorage.setItem('__tenant', result.tenantId!); |
|
|
|
} |
|
|
|
emits('change', tenant.value); |
|
|
|
modalApi.close(); |
|
|
|
|