Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
9887cf59
M
metersphere
项目概览
MeterSphere
/
metersphere
上一次同步 大约 3 年
通知
25
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
metersphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9887cf59
编写于
5月 21, 2020
作者:
W
wenyann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改
上级
94dd8372
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
34 deletion
+17
-34
backend/src/main/java/io/metersphere/commons/constants/ParamConstants.java
...java/io/metersphere/commons/constants/ParamConstants.java
+1
-0
backend/src/main/java/io/metersphere/controller/SystemParameterController.java
.../io/metersphere/controller/SystemParameterController.java
+6
-4
backend/src/main/java/io/metersphere/service/SystemParameterService.java
...n/java/io/metersphere/service/SystemParameterService.java
+5
-3
frontend/src/business/components/settings/system/SystemParameterSetting.vue
...ess/components/settings/system/SystemParameterSetting.vue
+5
-27
未找到文件。
backend/src/main/java/io/metersphere/commons/constants/ParamConstants.java
浏览文件 @
9887cf59
...
...
@@ -85,6 +85,7 @@ public interface ParamConstants {
this
.
value
=
value
;
}
}
public
static
enum
MAIL
{
HOST
(
"meter.host"
,
1
),
PORT
(
"meter.port"
,
2
),
...
...
backend/src/main/java/io/metersphere/controller/SystemParameterController.java
浏览文件 @
9887cf59
...
...
@@ -15,13 +15,15 @@ import java.util.List;
@RequestMapping
(
value
=
"/system"
)
public
class
SystemParameterController
{
@Resource
private
SystemParameterService
SystemParameterService
;
private
SystemParameterService
SystemParameterService
;
@PostMapping
(
"/edit/email"
)
public
void
editMail
(
@RequestBody
List
<
SystemParameter
>
SystemParameter
)
{
SystemParameterService
.
editMail
(
S
ystemParameter
);
public
void
editMail
(
@RequestBody
List
<
SystemParameter
>
systemParameter
)
{
SystemParameterService
.
editMail
(
s
ystemParameter
);
}
@PostMapping
(
"/testConnection"
)
public
void
testConnection
(
@RequestBody
HashMap
<
String
,
String
>
hashMap
){
public
void
testConnection
(
@RequestBody
HashMap
<
String
,
String
>
hashMap
)
{
SystemParameterService
.
testConnection
(
hashMap
);
}
...
...
backend/src/main/java/io/metersphere/service/SystemParameterService.java
浏览文件 @
9887cf59
...
...
@@ -9,6 +9,7 @@ import org.apache.commons.collections.CollectionUtils;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Properties
;
...
...
@@ -16,7 +17,6 @@ import java.util.Properties;
import
org.springframework.mail.javamail.JavaMailSenderImpl
;
import
javax.annotation.Resource
;
...
...
@@ -39,7 +39,8 @@ public class SystemParameterService {
}
return
result
;
}
public
void
editMail
(
List
<
SystemParameter
>
parameters
){
public
void
editMail
(
List
<
SystemParameter
>
parameters
)
{
List
<
SystemParameter
>
paramList
=
this
.
getParamList
(
ParamConstants
.
Classify
.
MAIL
.
getValue
());
boolean
empty
=
paramList
.
size
()
<
2
;
parameters
.
forEach
(
parameter
->
{
...
...
@@ -54,13 +55,14 @@ public class SystemParameterService {
}
});
}
public
List
<
SystemParameter
>
getParamList
(
String
type
)
{
SystemParameterExample
example
=
new
SystemParameterExample
();
example
.
createCriteria
().
andParamKeyLike
(
type
+
"%"
);
return
systemParameterMapper
.
selectByExample
(
example
);
}
public
void
testConnection
(
HashMap
<
String
,
String
>
hashMap
){
public
void
testConnection
(
HashMap
<
String
,
String
>
hashMap
)
{
JavaMailSenderImpl
javaMailSender
=
new
JavaMailSenderImpl
();
javaMailSender
.
setDefaultEncoding
(
"UTF-8"
);
javaMailSender
.
setHost
(
hashMap
.
get
(
ParamConstants
.
MAIL
.
PORT
.
getKey
()));
...
...
frontend/src/business/components/settings/system/SystemParameterSetting.vue
浏览文件 @
9887cf59
...
...
@@ -12,7 +12,7 @@
<el-form-item
:label=
"$t('system_parameter_setting.SMTP_host')"
prop=
"host"
>
</el-form-item>
<el-input
v-model=
"formInline.host"
:placeholder=
"$t('system_parameter_setting.SMTP_host')"
v-on:input=
"
host('host'
)"
></el-input>
v-on:input=
"
change(
)"
></el-input>
</el-col>
</el-row>
<el-row>
...
...
@@ -20,7 +20,7 @@
<el-form-item
:label=
"$t('system_parameter_setting.SMTP_port')"
prop=
"port"
>
</el-form-item>
<el-input
v-model=
"formInline.port"
:placeholder=
"$t('system_parameter_setting.SMTP_port')"
v-on:input=
"
port('port'
)"
></el-input>
v-on:input=
"
change(
)"
></el-input>
</el-col>
</el-row>
<el-row>
...
...
@@ -28,7 +28,7 @@
<el-form-item
:label=
"$t('system_parameter_setting.SMTP_account')"
prop=
"account"
>
</el-form-item>
<el-input
v-model=
"formInline.account"
:placeholder=
"$t('system_parameter_setting.SMTP_account')"
v-on:input=
"
account('account'
)"
></el-input>
v-on:input=
"
change(
)"
></el-input>
</el-col>
</el-row>
<el-row>
...
...
@@ -114,30 +114,8 @@
methods
:
{
host
()
{
let
host
=
this
.
formInline
.
host
;
if
(
!
host
)
{
this
.
disabledConnection
=
true
;
this
.
disabledSave
=
true
;
}
else
{
this
.
disabledConnection
=
false
;
this
.
disabledSave
=
false
;
}
},
port
()
{
let
port
=
this
.
formInline
.
port
;
if
(
!
port
)
{
this
.
disabledConnection
=
true
;
this
.
disabledSave
=
true
;
}
else
{
this
.
disabledConnection
=
false
;
this
.
disabledSave
=
false
;
}
},
account
()
{
let
account
=
this
.
formInline
.
account
;
if
(
!
account
)
{
change
()
{
if
(
!
this
.
formInline
.
host
||
!
this
.
formInline
.
port
||
!
this
.
formInline
.
account
)
{
this
.
disabledConnection
=
true
;
this
.
disabledSave
=
true
;
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录