修复钉钉配置保存问题:确保enabledFeatures正确保存到数据库,保存后重新加载配置
This commit is contained in:
parent
ad343c357e
commit
9c71237bdf
@ -55,13 +55,16 @@ public class DingTalkController {
|
||||
try {
|
||||
// 处理enabledFeatures字段
|
||||
Object enabledFeaturesObj = configMap.get("enabledFeatures");
|
||||
String enabledFeaturesJson = null;
|
||||
String enabledFeaturesJson = "{}"; // 默认为空JSON对象
|
||||
if (enabledFeaturesObj != null) {
|
||||
if (enabledFeaturesObj instanceof String) {
|
||||
enabledFeaturesJson = (String) enabledFeaturesObj;
|
||||
} else {
|
||||
} else if (enabledFeaturesObj instanceof Map && !((Map<?, ?>) enabledFeaturesObj).isEmpty()) {
|
||||
// 转换为JSON字符串
|
||||
enabledFeaturesJson = objectMapper.writeValueAsString(enabledFeaturesObj);
|
||||
} else {
|
||||
// 如果是空对象或null,使用空JSON对象
|
||||
enabledFeaturesJson = "{}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2335,6 +2335,8 @@ const handleSaveDingTalk = async () => {
|
||||
|
||||
await saveDingTalkConfig(configToSave as any)
|
||||
message.success('钉钉配置保存成功')
|
||||
// 重新加载配置以确保UI同步
|
||||
await loadDingTalkConfig()
|
||||
} catch (error: any) {
|
||||
message.error(error.message || '保存失败')
|
||||
} finally {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user