Browse Source

feat: 租户cookie改为store

pull/1155/head
colin 10 months ago
parent
commit
703eb4aca0
  1. 1
      apps/vben5/packages/@abp/saas/src/components/tenants/TenantSelect.vue
  2. 2
      apps/vben5/packages/@abp/saas/src/components/tenants/TenantSelectModal.vue

1
apps/vben5/packages/@abp/saas/src/components/tenants/TenantSelect.vue

@ -34,6 +34,7 @@ function onSwitchClick() {
}
function onChange(tenant?: { id?: string; name?: string }) {
abpStore.setTenantId(tenant?.id);
emits('change', tenant);
}
</script>

2
apps/vben5/packages/@abp/saas/src/components/tenants/TenantSelectModal.vue

@ -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();

Loading…
Cancel
Save