forked from fanruan/design
Browse Source
* commit '320a7fd93e73e4ea0d851ff23dfed39cd4918473': REPORT-77217 ConnectionProvider-修改之后数据连接信息无法保存 同步10.0 【问题原因】产生假保存的原因是,在保存的时候会判断现有的Connection与以前存储的Connection是否有不同,如果不同就代表需要更新。实际上插件中的Connection相关类没有写equals方法,然后新旧Connection被认为是相同了,就没有走后面的更新配置的逻辑 【改动方案】拉rinoux、vito、hugh一起沟通了下方案,暂时主代码里做个兼容,让主代码内置的两种Connection去判断是否要更新,其余的Connection(插件Connection)都必须更新 【review建议】同步10.0 单独写一个 DefaultLoginKeys REPORT-72595 FR源码中存在加密密钥硬编码,建议放到配置文件中
superman
2 years ago
5 changed files with 122 additions and 4 deletions
@ -0,0 +1,48 @@
|
||||
package com.fr.design.login.config; |
||||
|
||||
import com.fr.log.FineLoggerFactory; |
||||
import java.io.IOException; |
||||
import java.io.InputStream; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
import java.util.Properties; |
||||
|
||||
/** |
||||
* @author Lanlan |
||||
* @version 10.0 |
||||
* Created by Lanlan on 2022/6/20 |
||||
*/ |
||||
public class DefaultLoginKeys { |
||||
|
||||
private static final String FILENAME = "com/fr/design/config/default"; |
||||
|
||||
private static final DefaultLoginKeys INSTANCE = new DefaultLoginKeys(); |
||||
|
||||
public static DefaultLoginKeys getInstance() { |
||||
return INSTANCE; |
||||
} |
||||
|
||||
private final Map<String, String> keys = new HashMap<>(); |
||||
|
||||
private DefaultLoginKeys() { |
||||
Properties properties = load(); |
||||
for (Map.Entry<Object, Object> entry : properties.entrySet()) { |
||||
String name = entry.getKey().toString(); |
||||
keys.put(name, entry.getValue().toString()); |
||||
} |
||||
} |
||||
|
||||
public String getKey(String name) { |
||||
return keys.get(name); |
||||
} |
||||
|
||||
private Properties load() { |
||||
Properties properties = new Properties(); |
||||
try (InputStream inputStream = DefaultLoginKeys.class.getClassLoader().getResourceAsStream(FILENAME)) { |
||||
properties.load(inputStream); |
||||
} catch (IOException e) { |
||||
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
||||
} |
||||
return properties; |
||||
} |
||||
} |
Loading…
Reference in new issue