From 841388019718128897271f556f3b0b4cb650cd85 Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Tue, 7 May 2024 03:30:01 +0800 Subject: [PATCH] Avoid overwriting the encrypted values with null --- common.props | 2 +- .../SettingUiAppService.cs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/common.props b/common.props index 487bcc7..04d2728 100644 --- a/common.props +++ b/common.props @@ -1,7 +1,7 @@ latest - 2.0.0 + 2.0.1 $(NoWarn);CS1591 true EasyAbp Team diff --git a/src/EasyAbp.Abp.SettingUi.Application/SettingUiAppService.cs b/src/EasyAbp.Abp.SettingUi.Application/SettingUiAppService.cs index fe6673f..604445a 100644 --- a/src/EasyAbp.Abp.SettingUi.Application/SettingUiAppService.cs +++ b/src/EasyAbp.Abp.SettingUi.Application/SettingUiAppService.cs @@ -146,6 +146,17 @@ public virtual async Task SetSettingValuesAsync(Dictionary setti continue; } + // new value is null. + if (kv.Value.IsNullOrEmpty()) + { + // it's an encrypted setting value, and it's currently on the tenant side. + if (setting.IsEncrypted && CurrentTenant.IsAvailable) + { + // don't update. + continue; + } + } + await SetSettingAsync(setting, kv.Value); // todo: needs permission check? } }