fix(系统设置): 配置邮件错误提示问题

--bug=1026576 --user=宋昌昌 【系统设置】配置存在问题时邮件测试未提示错误 https://www.tapd.cn/55049933/s/1378123
This commit is contained in:
song-cc-rock 2023-06-02 11:55:58 +08:00 committed by fit2-zhao
parent cd617558a3
commit f42c529128
2 changed files with 15 additions and 3 deletions

View File

@ -125,10 +125,11 @@ public class SystemParameterService {
}
public void testConnection(HashMap<String, String> hashMap) {
JavaMailSenderImpl javaMailSender = mailNoticeSender.getMailSender(hashMap);
JavaMailSenderImpl javaMailSender = null;
try {
javaMailSender = mailNoticeSender.getMailSender(hashMap);
javaMailSender.testConnection();
} catch (MessagingException e) {
} catch (Exception e) {
LogUtil.error(e.getMessage(), e);
MSException.throwException(Translator.get("connection_failed"));
}

View File

@ -89,6 +89,14 @@ import {getSystemMailServerInfo, modifySystemMailServerInfo, testMailServerConne
export default {
name: "EmailSetting",
data() {
const validatorPortNum = (value, callback) => {
const numExp = /^[0-9]*$/
if (!numExp.test(value)) {
callback(new Error("Port" + this.$t("commons.type_of_num")))
}else{
callback()
}
}
return {
formInline: {},
input: '',
@ -112,7 +120,10 @@ export default {
{
required: true,
message: this.$t('system_parameter_setting.port'),
trigger: ['change', 'blur']
trigger: ['change', 'blur'],
},
{
validator: validatorPortNum, trigger: ['change', 'blur'],
}
],
account: [