Unverified Commit 609f2144 authored by gaoyan's avatar gaoyan Committed by GitHub

[Fix]Fix Email smtpSslTrust NPE (#2979)

parent e0ba0c54
......@@ -44,5 +44,5 @@ public class EmailParams {
private boolean sslEnable;
private String user;
private String password;
private String smtpSslTrust;
private String smtpSslTrust = "";
}
......@@ -32,6 +32,7 @@ import java.util.Set;
import java.util.stream.Collectors;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.text.StrFormatter;
import cn.hutool.core.util.StrUtil;
/**
......@@ -50,16 +51,14 @@ public class URLUtils {
try {
URL url = new URL(urlPath);
URLConnection urlConnection = url.openConnection();
if ("http".equals(url.getProtocol())
|| "https".equals(url.getProtocol())
|| "hdfs".equals(url.getProtocol())) {
} else if ("rs".equals(url.getProtocol())) {
if ("rs".equals(url.getProtocol())) {
String path = StrUtil.join(File.separator, TMP_PATH, "rs", url.getPath());
return FileUtil.writeFromStream(urlConnection.getInputStream(), path);
} else if ("file".equals(url.getProtocol())) {
return new File(url.getPath());
}
return null;
throw new RuntimeException(StrFormatter.format(
"The path {} unsupported protocol: {},please use rs:// or file://", urlPath, url.getProtocol()));
} catch (Exception e) {
throw new RuntimeException(e);
}
......
......@@ -106,12 +106,15 @@ export const FormSingleColumnList = (props: FormSingleColumnListProps) => {
onClick={async () => {
// 获取前一项的值
const lastItem = fields[fields.length === 0 ? 0 : fields.length - 1];
if (!lastItem) {
add();
return;
}
const addBeforePreItem = form.getFieldValue([...namePath, lastItem.name]);
if (!addBeforePreItem) {
await ErrorMessageAsync(l('rc.ai.previousItemRequired'));
return;
} else if (fields.length >= max) {
console.log(fields.length);
await ErrorMessageAsync(l('rc.ai.atMost', '', { max }));
return;
} else {
......
......@@ -123,7 +123,7 @@ const Email = (props: EmailProps) => {
inputPlaceholder={l('rc.ai.receiverCcsPleaseHolder')}
title={l('rc.ai.receiverCcsMax', '', { max: 10 })}
max={10}
min={1}
min={0}
plain={true}
/>
</ProCard>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment