Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
6cf137f7
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,发现更多精彩内容 >>
提交
6cf137f7
编写于
7月 09, 2020
作者:
S
shiziyuan9527
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://github.com/metersphere/metersphere
上级
e71e8668
cf9cffb1
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
379 addition
and
182 deletion
+379
-182
backend/src/main/java/io/metersphere/api/dto/parse/swagger/SwaggerApi.java
...java/io/metersphere/api/dto/parse/swagger/SwaggerApi.java
+17
-0
backend/src/main/java/io/metersphere/api/dto/parse/swagger/SwaggerInfo.java
...ava/io/metersphere/api/dto/parse/swagger/SwaggerInfo.java
+11
-0
backend/src/main/java/io/metersphere/api/dto/parse/swagger/SwaggerParameter.java
...o/metersphere/api/dto/parse/swagger/SwaggerParameter.java
+13
-0
backend/src/main/java/io/metersphere/api/dto/parse/swagger/SwaggerRequest.java
.../io/metersphere/api/dto/parse/swagger/SwaggerRequest.java
+16
-0
backend/src/main/java/io/metersphere/api/dto/parse/swagger/SwaggerTag.java
...java/io/metersphere/api/dto/parse/swagger/SwaggerTag.java
+9
-0
backend/src/main/java/io/metersphere/api/parse/PostmanParser.java
...src/main/java/io/metersphere/api/parse/PostmanParser.java
+0
-167
backend/src/main/java/io/metersphere/api/parse/SwaggerParser.java
...src/main/java/io/metersphere/api/parse/SwaggerParser.java
+106
-0
backend/src/main/java/io/metersphere/api/service/APITestService.java
.../main/java/io/metersphere/api/service/APITestService.java
+17
-0
backend/src/main/java/io/metersphere/service/SystemParameterService.java
...n/java/io/metersphere/service/SystemParameterService.java
+20
-8
frontend/src/business/components/api/test/model/ScenarioModel.js
...d/src/business/components/api/test/model/ScenarioModel.js
+7
-1
frontend/src/business/components/performance/report/components/RequestStatistics.vue
...nents/performance/report/components/RequestStatistics.vue
+3
-0
frontend/src/business/components/project/MsProject.vue
frontend/src/business/components/project/MsProject.vue
+1
-1
frontend/src/business/components/settings/personal/PersonSetting.vue
...c/business/components/settings/personal/PersonSetting.vue
+12
-2
frontend/src/business/components/settings/system/SystemParameterSetting.vue
...ess/components/settings/system/SystemParameterSetting.vue
+138
-1
frontend/src/business/components/settings/system/User.vue
frontend/src/business/components/settings/system/User.vue
+2
-2
frontend/src/business/components/track/case/components/TestCaseEdit.vue
...usiness/components/track/case/components/TestCaseEdit.vue
+7
-0
未找到文件。
backend/src/main/java/io/metersphere/api/dto/parse/swagger/SwaggerApi.java
0 → 100644
浏览文件 @
6cf137f7
package
io.metersphere.api.dto.parse.swagger
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
SwaggerApi
{
private
String
swagger
;
private
SwaggerInfo
info
;
private
String
host
;
private
String
basePath
;
private
List
<
String
>
schemes
;
private
List
<
SwaggerTag
>
tags
;
private
JSONObject
paths
;
}
backend/src/main/java/io/metersphere/api/dto/parse/swagger/SwaggerInfo.java
0 → 100644
浏览文件 @
6cf137f7
package
io.metersphere.api.dto.parse.swagger
;
import
lombok.Data
;
@Data
public
class
SwaggerInfo
{
private
String
version
;
private
String
title
;
private
String
description
;
private
String
termsOfService
;
}
backend/src/main/java/io/metersphere/api/dto/parse/swagger/SwaggerParameter.java
0 → 100644
浏览文件 @
6cf137f7
package
io.metersphere.api.dto.parse.swagger
;
import
lombok.Data
;
@Data
public
class
SwaggerParameter
{
private
String
name
;
private
String
in
;
private
String
description
;
private
Boolean
required
;
private
String
type
;
private
String
format
;
}
backend/src/main/java/io/metersphere/api/dto/parse/swagger/SwaggerRequest.java
0 → 100644
浏览文件 @
6cf137f7
package
io.metersphere.api.dto.parse.swagger
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
SwaggerRequest
{
private
List
<
String
>
tags
;
private
String
summary
;
private
String
description
;
private
String
operationId
;
private
List
<
String
>
consumes
;
private
List
<
String
>
produces
;
private
SwaggerParameter
parameters
;
}
backend/src/main/java/io/metersphere/api/dto/parse/swagger/SwaggerTag.java
0 → 100644
浏览文件 @
6cf137f7
package
io.metersphere.api.dto.parse.swagger
;
import
lombok.Data
;
@Data
public
class
SwaggerTag
{
private
String
name
;
private
String
description
;
}
backend/src/main/java/io/metersphere/api/parse/PostmanParser.java
浏览文件 @
6cf137f7
...
...
@@ -27,173 +27,6 @@ public class PostmanParser extends ApiImportAbstractParser {
@Override
public
ApiImport
parse
(
InputStream
source
)
{
String
testStr
=
getApiTestStr
(
source
);
// String testStr = "{\n" +
// "\t\"info\": {\n" +
// "\t\t\"_postman_id\": \"9721cd51-8626-4f61-9ac1-e77b8399cca8\",\n" +
// "\t\t\"name\": \"test\",\n" +
// "\t\t\"schema\": \"https://schema.getpostman.com/json/collection/v2.1.0/collection.json\"\n" +
// "\t},\n" +
// "\t\"item\": [\n" +
// "\t\t{\n" +
// "\t\t\t\"name\": \"test\",\n" +
// "\t\t\t\"request\": {\n" +
// "\t\t\t\t\"auth\": {\n" +
// "\t\t\t\t\t\"type\": \"basic\",\n" +
// "\t\t\t\t\t\"basic\": [\n" +
// "\t\t\t\t\t\t{\n" +
// "\t\t\t\t\t\t\t\"key\": \"password\",\n" +
// "\t\t\t\t\t\t\t\"value\": \"test\",\n" +
// "\t\t\t\t\t\t\t\"type\": \"string\"\n" +
// "\t\t\t\t\t\t},\n" +
// "\t\t\t\t\t\t{\n" +
// "\t\t\t\t\t\t\t\"key\": \"username\",\n" +
// "\t\t\t\t\t\t\t\"value\": \"test\",\n" +
// "\t\t\t\t\t\t\t\"type\": \"string\"\n" +
// "\t\t\t\t\t\t}\n" +
// "\t\t\t\t\t]\n" +
// "\t\t\t\t},\n" +
// "\t\t\t\t\"method\": \"POST\",\n" +
// "\t\t\t\t\"header\": [\n" +
// "\t\t\t\t\t{\n" +
// "\t\t\t\t\t\t\"key\": \"aaa\",\n" +
// "\t\t\t\t\t\t\"value\": \"testH\",\n" +
// "\t\t\t\t\t\t\"type\": \"text\"\n" +
// "\t\t\t\t\t}\n" +
// "\t\t\t\t],\n" +
// "\t\t\t\t\"body\": {\n" +
// "\t\t\t\t\t\"mode\": \"raw\",\n" +
// "\t\t\t\t\t\"raw\": \"<html>\\n</html>\\n\",\n" +
// "\t\t\t\t\t\"options\": {\n" +
// "\t\t\t\t\t\t\"raw\": {\n" +
// "\t\t\t\t\t\t\t\"language\": \"html\"\n" +
// "\t\t\t\t\t\t}\n" +
// "\t\t\t\t\t}\n" +
// "\t\t\t\t},\n" +
// "\t\t\t\t\"url\": {\n" +
// "\t\t\t\t\t\"raw\": \"https://localhost:8080?tset=test\",\n" +
// "\t\t\t\t\t\"protocol\": \"https\",\n" +
// "\t\t\t\t\t\"host\": [\n" +
// "\t\t\t\t\t\t\"localhost\"\n" +
// "\t\t\t\t\t],\n" +
// "\t\t\t\t\t\"port\": \"8080\",\n" +
// "\t\t\t\t\t\"query\": [\n" +
// "\t\t\t\t\t\t{\n" +
// "\t\t\t\t\t\t\t\"key\": \"tset\",\n" +
// "\t\t\t\t\t\t\t\"value\": \"test\",\n" +
// "\t\t\t\t\t\t\t\"description\": \"test\"\n" +
// "\t\t\t\t\t\t}\n" +
// "\t\t\t\t\t]\n" +
// "\t\t\t\t},\n" +
// "\t\t\t\t\"description\": \"dd\"\n" +
// "\t\t\t},\n" +
// "\t\t\t\"response\": []\n" +
// "\t\t},\n" +
// "\t\t{\n" +
// "\t\t\t\"name\": \"test Copy\",\n" +
// "\t\t\t\"request\": {\n" +
// "\t\t\t\t\"auth\": {\n" +
// "\t\t\t\t\t\"type\": \"basic\",\n" +
// "\t\t\t\t\t\"basic\": [\n" +
// "\t\t\t\t\t\t{\n" +
// "\t\t\t\t\t\t\t\"key\": \"password\",\n" +
// "\t\t\t\t\t\t\t\"value\": \"test\",\n" +
// "\t\t\t\t\t\t\t\"type\": \"string\"\n" +
// "\t\t\t\t\t\t},\n" +
// "\t\t\t\t\t\t{\n" +
// "\t\t\t\t\t\t\t\"key\": \"username\",\n" +
// "\t\t\t\t\t\t\t\"value\": \"test\",\n" +
// "\t\t\t\t\t\t\t\"type\": \"string\"\n" +
// "\t\t\t\t\t\t}\n" +
// "\t\t\t\t\t]\n" +
// "\t\t\t\t},\n" +
// "\t\t\t\t\"method\": \"POST\",\n" +
// "\t\t\t\t\"header\": [\n" +
// "\t\t\t\t\t{\n" +
// "\t\t\t\t\t\t\"key\": \"testH\",\n" +
// "\t\t\t\t\t\t\"value\": \"testH\",\n" +
// "\t\t\t\t\t\t\"type\": \"text\"\n" +
// "\t\t\t\t\t}\n" +
// "\t\t\t\t],\n" +
// "\t\t\t\t\"body\": {\n" +
// "\t\t\t\t\t\"mode\": \"raw\",\n" +
// "\t\t\t\t\t\"raw\": \"{\\\"name\\\":\\\"test\\\"}\\n\",\n" +
// "\t\t\t\t\t\"options\": {\n" +
// "\t\t\t\t\t\t\"raw\": {\n" +
// "\t\t\t\t\t\t\t\"language\": \"json\"\n" +
// "\t\t\t\t\t\t}\n" +
// "\t\t\t\t\t}\n" +
// "\t\t\t\t},\n" +
// "\t\t\t\t\"url\": {\n" +
// "\t\t\t\t\t\"raw\": \"http://localhost:8081\",\n" +
// "\t\t\t\t\t\"protocol\": \"http\",\n" +
// "\t\t\t\t\t\"host\": [\n" +
// "\t\t\t\t\t\t\"localhost\"\n" +
// "\t\t\t\t\t],\n" +
// "\t\t\t\t\t\"port\": \"8081\"\n" +
// "\t\t\t\t},\n" +
// "\t\t\t\t\"description\": \"dd\"\n" +
// "\t\t\t},\n" +
// "\t\t\t\"response\": []\n" +
// "\t\t},\n" +
// "\t\t{\n" +
// "\t\t\t\"name\": \"test Copy Copy\",\n" +
// "\t\t\t\"request\": {\n" +
// "\t\t\t\t\"auth\": {\n" +
// "\t\t\t\t\t\"type\": \"basic\",\n" +
// "\t\t\t\t\t\"basic\": [\n" +
// "\t\t\t\t\t\t{\n" +
// "\t\t\t\t\t\t\t\"key\": \"password\",\n" +
// "\t\t\t\t\t\t\t\"value\": \"test\",\n" +
// "\t\t\t\t\t\t\t\"type\": \"string\"\n" +
// "\t\t\t\t\t\t},\n" +
// "\t\t\t\t\t\t{\n" +
// "\t\t\t\t\t\t\t\"key\": \"username\",\n" +
// "\t\t\t\t\t\t\t\"value\": \"test\",\n" +
// "\t\t\t\t\t\t\t\"type\": \"string\"\n" +
// "\t\t\t\t\t\t}\n" +
// "\t\t\t\t\t]\n" +
// "\t\t\t\t},\n" +
// "\t\t\t\t\"method\": \"POST\",\n" +
// "\t\t\t\t\"header\": [\n" +
// "\t\t\t\t\t{\n" +
// "\t\t\t\t\t\t\"key\": \"testH\",\n" +
// "\t\t\t\t\t\t\"value\": \"testH\",\n" +
// "\t\t\t\t\t\t\"type\": \"text\"\n" +
// "\t\t\t\t\t}\n" +
// "\t\t\t\t],\n" +
// "\t\t\t\t\"body\": {\n" +
// "\t\t\t\t\t\"mode\": \"urlencoded\",\n" +
// "\t\t\t\t\t\"urlencoded\": [\n" +
// "\t\t\t\t\t\t{\n" +
// "\t\t\t\t\t\t\t\"key\": \"test\",\n" +
// "\t\t\t\t\t\t\t\"value\": \"tset\",\n" +
// "\t\t\t\t\t\t\t\"description\": \"dd\",\n" +
// "\t\t\t\t\t\t\t\"type\": \"text\"\n" +
// "\t\t\t\t\t\t}\n" +
// "\t\t\t\t\t],\n" +
// "\t\t\t\t\t\"options\": {\n" +
// "\t\t\t\t\t\t\"raw\": {\n" +
// "\t\t\t\t\t\t\t\"language\": \"json\"\n" +
// "\t\t\t\t\t\t}\n" +
// "\t\t\t\t\t}\n" +
// "\t\t\t\t},\n" +
// "\t\t\t\t\"url\": {\n" +
// "\t\t\t\t\t\"raw\": \"http://localhost:8081\",\n" +
// "\t\t\t\t\t\"protocol\": \"http\",\n" +
// "\t\t\t\t\t\"host\": [\n" +
// "\t\t\t\t\t\t\"localhost\"\n" +
// "\t\t\t\t\t],\n" +
// "\t\t\t\t\t\"port\": \"8081\"\n" +
// "\t\t\t\t},\n" +
// "\t\t\t\t\"description\": \"dd\"\n" +
// "\t\t\t},\n" +
// "\t\t\t\"response\": []\n" +
// "\t\t}\n" +
// "\t],\n" +
// "\t\"protocolProfileBehavior\": {}\n" +
// "}";
PostmanCollection
postmanCollection
=
JSON
.
parseObject
(
testStr
.
toString
(),
PostmanCollection
.
class
);
PostmanCollectionInfo
info
=
postmanCollection
.
getInfo
();
List
<
Request
>
requests
=
parseRequests
(
postmanCollection
);
...
...
backend/src/main/java/io/metersphere/api/parse/SwaggerParser.java
0 → 100644
浏览文件 @
6cf137f7
package
io.metersphere.api.parse
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
io.metersphere.api.dto.parse.ApiImport
;
import
io.metersphere.api.dto.parse.postman.PostmanItem
;
import
io.metersphere.api.dto.parse.postman.PostmanRequest
;
import
io.metersphere.api.dto.parse.postman.PostmanUrl
;
import
io.metersphere.api.dto.parse.swagger.SwaggerApi
;
import
io.metersphere.api.dto.parse.swagger.SwaggerInfo
;
import
io.metersphere.api.dto.parse.swagger.SwaggerRequest
;
import
io.metersphere.api.dto.scenario.Request
;
import
io.metersphere.api.dto.scenario.Scenario
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Set
;
public
class
SwaggerParser
extends
ApiImportAbstractParser
{
@Override
public
ApiImport
parse
(
InputStream
source
)
{
String
testStr
=
getApiTestStr
(
source
);
SwaggerApi
swaggerApi
=
JSON
.
parseObject
(
testStr
.
toString
(),
SwaggerApi
.
class
);
SwaggerInfo
info
=
swaggerApi
.
getInfo
();
String
title
=
info
.
getTitle
();
// List<Request> requests = parseRequests(swaggerApi);
// ApiImport apiImport = new ApiImport();
// List<Scenario> scenarios = new ArrayList<>();
// Scenario scenario = new Scenario();
// scenario.setRequests(requests);
// scenario.setName(info.getName());
// scenarios.add(scenario);
// apiImport.setScenarios(scenarios);
// return apiImport;
return
null
;
}
// private List<Request> parseRequests(SwaggerApi swaggerApi) {
// JSONObject paths = swaggerApi.getPaths();
//
// Set<String> pathNames = paths.keySet();
//
// for (String path : pathNames) {
// JSONObject pathObject = paths.getJSONObject(path);
// Set<String> methods = pathObject.keySet();
// for (String method : methods) {
// SwaggerRequest swaggerRequest = JSON.parseObject(pathObject.getJSONObject(method).toJSONString(), SwaggerRequest.class);
// Request request = new Request();
// request.setName(swaggerRequest.getOperationId());
// request.setUrl(url.getRaw());
// request.setPath(.getRaw());
// request.setUseEnvironment(false);
// request.setMethod(requestDesc.getMethod());
// request.setHeaders(parseKeyValue(requestDesc.getHeader()));
// request.setParameters(parseKeyValue(url.getQuery()));
//
// }
// }
//
// List<PostmanItem> item = postmanCollection.getItem();
// List<Request> requests = new ArrayList<>();
// for (PostmanItem requestItem : item) {
// Request request = new Request();
// PostmanRequest requestDesc = requestItem.getRequest();
// PostmanUrl url = requestDesc.getUrl();
// request.setName(requestItem.getName());
// request.setUrl(url.getRaw());
// request.setUseEnvironment(false);
// request.setMethod(requestDesc.getMethod());
// request.setHeaders(parseKeyValue(requestDesc.getHeader()));
// request.setParameters(parseKeyValue(url.getQuery()));
// Body body = new Body();
// JSONObject postmanBody = requestDesc.getBody();
// String bodyMode = postmanBody.getString("mode");
// if (StringUtils.equals(bodyMode, PostmanRequestBodyMode.RAW.value())) {
// body.setRaw(postmanBody.getString(bodyMode));
// body.setType(MsRequestBodyType.RAW.value());
// String contentType = postmanBody.getJSONObject("options").getJSONObject("raw").getString("language");
// List<KeyValue> headers = request.getHeaders();
// boolean hasContentType = false;
// for (KeyValue header : headers) {
// if (StringUtils.equalsIgnoreCase(header.getName(), "Content-Type")) {
// hasContentType = true;
// }
// }
// if (!hasContentType) {
// headers.add(new KeyValue("Content-Type", contentType));
// }
// } else if (StringUtils.equals(bodyMode, PostmanRequestBodyMode.FORM_DATA.value()) || StringUtils.equals(bodyMode, PostmanRequestBodyMode.URLENCODED.value())) {
// List<PostmanKeyValue> postmanKeyValues = JSON.parseArray(postmanBody.getString(bodyMode), PostmanKeyValue.class);
// body.setType(MsRequestBodyType.KV.value());
// body.setKvs(parseKeyValue(postmanKeyValues));
// }
// request.setBody(body);
// requests.add(request);
// }
// return requests;
// }
}
backend/src/main/java/io/metersphere/api/service/APITestService.java
浏览文件 @
6cf137f7
...
...
@@ -12,6 +12,7 @@ import io.metersphere.api.parse.MsParser;
import
io.metersphere.base.domain.*
;
import
io.metersphere.base.mapper.ApiTestFileMapper
;
import
io.metersphere.base.mapper.ApiTestMapper
;
import
io.metersphere.base.mapper.TestCaseMapper
;
import
io.metersphere.base.mapper.ext.ExtApiTestMapper
;
import
io.metersphere.commons.constants.APITestStatus
;
import
io.metersphere.commons.constants.FileType
;
...
...
@@ -57,6 +58,8 @@ public class APITestService {
private
APIReportService
apiReportService
;
@Resource
private
ScheduleService
scheduleService
;
@Resource
private
TestCaseMapper
testCaseMapper
;
public
List
<
APITestResult
>
list
(
QueryAPITestRequest
request
)
{
request
.
setOrders
(
ServiceUtils
.
getDefaultOrder
(
request
.
getOrders
()));
...
...
@@ -129,6 +132,20 @@ public class APITestService {
}
public
void
delete
(
String
testId
)
{
// 是否关联测试用例
TestCaseExample
testCaseExample
=
new
TestCaseExample
();
testCaseExample
.
createCriteria
().
andTestIdEqualTo
(
testId
);
List
<
TestCase
>
testCases
=
testCaseMapper
.
selectByExample
(
testCaseExample
);
if
(
testCases
.
size
()
>
0
)
{
String
caseName
=
""
;
for
(
int
i
=
0
;
i
<
testCases
.
size
();
i
++)
{
caseName
=
caseName
+
testCases
.
get
(
i
).
getName
()
+
","
;
}
caseName
=
caseName
.
substring
(
0
,
caseName
.
length
()
-
1
);
MSException
.
throwException
(
Translator
.
get
(
"related_case_del_fail_prefix"
)
+
caseName
+
Translator
.
get
(
"related_case_del_fail_suffix"
));
}
deleteFileByTestId
(
testId
);
apiReportService
.
deleteByTestId
(
testId
);
apiTestMapper
.
deleteByPrimaryKey
(
testId
);
...
...
backend/src/main/java/io/metersphere/service/SystemParameterService.java
浏览文件 @
6cf137f7
...
...
@@ -40,17 +40,24 @@ public class SystemParameterService {
public
void
editMail
(
List
<
SystemParameter
>
parameters
)
{
List
<
SystemParameter
>
paramList
=
this
.
getParamList
(
ParamConstants
.
Classify
.
MAIL
.
getValue
());
boolean
empty
=
paramList
.
size
()
<
2
;
boolean
empty
=
paramList
.
size
()
<=
0
;
parameters
.
forEach
(
parameter
->
{
SystemParameterExample
example
=
new
SystemParameterExample
();
if
(
parameter
.
getParamKey
().
equals
(
ParamConstants
.
MAIL
.
PASSWORD
.
getKey
()))
{
String
string
=
EncryptUtils
.
aesEncrypt
(
parameter
.
getParamValue
()).
toString
();
parameter
.
setParamValue
(
string
);
if
(!
StringUtils
.
isBlank
(
parameter
.
getParamValue
()))
{
String
string
=
EncryptUtils
.
aesEncrypt
(
parameter
.
getParamValue
()).
toString
();
parameter
.
setParamValue
(
string
);
}
}
if
(
empty
)
{
systemParameterMapper
.
insert
(
parameter
);
}
else
{
example
.
createCriteria
().
andParamKeyEqualTo
(
parameter
.
getParamKey
());
if
(
systemParameterMapper
.
countByExample
(
example
)
>
0
)
{
systemParameterMapper
.
updateByPrimaryKey
(
parameter
);
}
else
{
systemParameterMapper
.
insert
(
parameter
);
}
example
.
clear
();
});
}
...
...
@@ -68,6 +75,8 @@ public class SystemParameterService {
javaMailSender
.
setUsername
(
hashMap
.
get
(
ParamConstants
.
MAIL
.
ACCOUNT
.
getKey
()));
javaMailSender
.
setPassword
(
hashMap
.
get
(
ParamConstants
.
MAIL
.
PASSWORD
.
getKey
()));
Properties
props
=
new
Properties
();
props
.
put
(
"mail.smtp.timeout"
,
"5000"
);
props
.
put
(
"mail.smtp.connectiontimeout"
,
"5000"
);
props
.
put
(
"mail.smtp.auth"
,
"true"
);
if
(
BooleanUtils
.
toBoolean
(
hashMap
.
get
(
ParamConstants
.
MAIL
.
SSL
.
getKey
())))
{
props
.
put
(
"mail.smtp.socketFactory.class"
,
"javax.net.ssl.SSLSocketFactory"
);
...
...
@@ -105,8 +114,11 @@ public class SystemParameterService {
}
}
else
{
paramList
.
stream
().
filter
(
param
->
param
.
getParamKey
().
equals
(
ParamConstants
.
MAIL
.
PASSWORD
.
getKey
())).
forEach
(
param
->
{
String
string
=
EncryptUtils
.
aesDecrypt
(
param
.
getParamValue
()).
toString
();
param
.
setParamValue
(
string
);
if
(!
StringUtils
.
isBlank
(
param
.
getParamValue
()))
{
String
string
=
EncryptUtils
.
aesDecrypt
(
param
.
getParamValue
()).
toString
();
param
.
setParamValue
(
string
);
}
});
}
paramList
.
sort
(
Comparator
.
comparingInt
(
SystemParameter:
:
getSort
));
...
...
frontend/src/business/components/api/test/model/ScenarioModel.js
浏览文件 @
6cf137f7
...
...
@@ -405,7 +405,13 @@ class JMXRequest {
this
.
port
=
url
.
port
;
this
.
protocol
=
url
.
protocol
.
split
(
"
:
"
)[
0
];
if
(
this
.
method
.
toUpperCase
()
!==
"
GET
"
)
{
this
.
pathname
+=
url
.
search
.
replace
(
'
&
'
,
'
&
'
);
// this.pathname += url.search.replace('&', '&');
this
.
pathname
+=
'
?
'
;
request
.
parameters
.
forEach
(
parameter
=>
{
if
(
parameter
.
name
)
{
this
.
pathname
+=
(
parameter
.
name
+
'
=
'
+
parameter
.
value
+
'
&
'
);
}
});
}
}
}
...
...
frontend/src/business/components/performance/report/components/RequestStatistics.vue
浏览文件 @
6cf137f7
...
...
@@ -131,12 +131,15 @@
let
transactions
=
data
.
reduce
(
function
(
total
,
currentValue
)
{
return
total
+
parseFloat
(
currentValue
.
transactions
);
},
0
);
transactions
=
transactions
.
toFixed
(
2
);
let
received
=
data
.
reduce
(
function
(
total
,
currentValue
)
{
return
total
+
parseFloat
(
currentValue
.
received
);
},
0
);
received
=
received
.
toFixed
(
2
);
let
sent
=
data
.
reduce
(
function
(
total
,
currentValue
)
{
return
total
+
parseFloat
(
currentValue
.
sent
);
},
0
);
sent
=
sent
.
toFixed
(
2
);
let
error
=
(
Math
.
round
(
failSize
/
allSamples
*
10000
)
/
100
)
+
'
%
'
;
let
averageTime
=
(
averageTimeTotal
/
allSamples
).
toFixed
(
2
);
...
...
frontend/src/business/components/project/MsProject.vue
浏览文件 @
6cf137f7
...
...
@@ -44,7 +44,7 @@
</el-card>
</ms-main-container>
<el-dialog
:title=
"title"
:visible.sync=
"createVisible"
>
<el-dialog
:title=
"title"
:visible.sync=
"createVisible"
destroy-on-close
>
<el-form
:model=
"form"
:rules=
"rules"
ref=
"form"
label-position=
"right"
label-width=
"100px"
size=
"small"
>
<el-form-item
:label=
"$t('commons.name')"
prop=
"name"
>
<el-input
v-model=
"form.name"
autocomplete=
"off"
></el-input>
...
...
frontend/src/business/components/settings/personal/PersonSetting.vue
浏览文件 @
6cf137f7
...
...
@@ -57,7 +57,7 @@
</el-dialog>
<!--Change personal password-->
<el-dialog
:title=
"$t('member.edit_password')"
:visible.sync=
"editPasswordVisible"
width=
"35%"
left
>
<el-dialog
:title=
"$t('member.edit_password')"
:visible.sync=
"editPasswordVisible"
width=
"35%"
:before-close=
'closeDialog'
left
>
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"editPasswordForm"
label-width=
"120px"
class=
"demo-ruleForm"
>
<el-form-item
:label=
"$t('member.old_password')"
prop=
"password"
style=
"margin-bottom: 29px"
>
<el-input
v-model=
"ruleForm.password"
autocomplete=
"off"
show-password
/>
...
...
@@ -68,7 +68,7 @@
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<ms-dialog-footer
@
cancel=
"
editPasswordVisible = false
"
@
cancel=
"
cancel()
"
@
confirm=
"updatePassword('editPasswordForm')"
/>
</span>
</el-dialog>
...
...
@@ -156,6 +156,16 @@
editPassword
(
row
)
{
this
.
editPasswordVisible
=
true
;
},
cancel
(){
this
.
editPasswordVisible
=
false
;
this
.
ruleForm
.
password
=
""
;
this
.
ruleForm
.
newpassword
=
""
;
},
closeDialog
(){
this
.
editPasswordVisible
=
false
;
this
.
ruleForm
.
password
=
""
;
this
.
ruleForm
.
newpassword
=
""
;
},
updateUser
(
updateUserForm
)
{
this
.
$refs
[
updateUserForm
].
validate
(
valid
=>
{
if
(
valid
)
{
...
...
frontend/src/business/components/settings/system/SystemParameterSetting.vue
浏览文件 @
6cf137f7
...
...
@@ -21,7 +21,144 @@
},
data
()
{
return
{
activeName
:
'
email
'
formInline
:
{
/*host: 'smtp.163.com',
port: '465',
account: 'xjj0608@163.com',
password: '2345678',*/
},
input
:
''
,
visible
:
true
,
result
:
{},
showEdit
:
true
,
showSave
:
false
,
showCancel
:
false
,
show
:
true
,
disabledConnection
:
false
,
disabledSave
:
false
,
loading
:
false
,
activeName
:
'
email
'
,
rules
:
{
host
:
[
{
required
:
true
,
message
:
'
'
},
],
port
:
[
{
required
:
true
,
message
:
'
'
}
],
account
:
[
{
required
:
true
,
message
:
'
'
}]
}
}
},
activated
()
{
this
.
query
()
this
.
change
()
},
methods
:
{
changeType
()
{
this
.
$refs
.
input
=
'
password
'
},
query
()
{
this
.
result
=
this
.
$get
(
"
/system/mail/info
"
,
response
=>
{
this
.
$set
(
this
.
formInline
,
"
host
"
,
response
.
data
[
0
].
paramValue
);
this
.
$set
(
this
.
formInline
,
"
port
"
,
response
.
data
[
1
].
paramValue
);
this
.
$set
(
this
.
formInline
,
"
account
"
,
response
.
data
[
2
].
paramValue
);
this
.
$set
(
this
.
formInline
,
"
password
"
,
response
.
data
[
3
].
paramValue
);
if
(
response
.
data
[
4
].
paramValue
!=
""
){
this
.
$set
(
this
.
formInline
,
"
SSL
"
,
JSON
.
parse
(
response
.
data
[
4
].
paramValue
));
}
if
(
response
.
data
[
5
].
paramValue
!=
""
){
this
.
$set
(
this
.
formInline
,
"
TLS
"
,
JSON
.
parse
(
response
.
data
[
5
].
paramValue
));
}
if
(
response
.
data
[
6
].
paramValue
!=
""
){
this
.
$set
(
this
.
formInline
,
"
SMTP
"
,
JSON
.
parse
(
response
.
data
[
6
].
paramValue
));
}
})
},
change
()
{
if
(
!
this
.
formInline
.
host
||
!
this
.
formInline
.
port
||
!
this
.
formInline
.
account
)
{
this
.
disabledConnection
=
true
;
this
.
disabledSave
=
true
;
}
else
{
this
.
disabledConnection
=
false
;
this
.
disabledSave
=
false
;
}
},
testConnection
(
formInline
)
{
let
param
=
{
"
smtp.server
"
:
this
.
formInline
.
host
,
"
smtp.port
"
:
this
.
formInline
.
port
,
"
smtp.account
"
:
this
.
formInline
.
account
,
"
smtp.password
"
:
this
.
formInline
.
password
,
"
smtp.ssl
"
:
this
.
formInline
.
SSL
,
"
smtp.tls
"
:
this
.
formInline
.
TLS
,
"
smtp.smtp
"
:
this
.
formInline
.
SMTP
,
};
this
.
$refs
[
formInline
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
result
=
this
.
$post
(
"
/system/testConnection
"
,
param
,
response
=>
{
this
.
$success
(
this
.
$t
(
'
commons.connection_successful
'
));
})
}
else
{
return
false
;
}
})
},
edit
()
{
this
.
change
()
this
.
showEdit
=
false
;
this
.
showSave
=
true
;
this
.
showCancel
=
true
;
this
.
show
=
false
;
},
save
(
formInline
)
{
this
.
showEdit
=
true
;
this
.
showCancel
=
false
;
this
.
showSave
=
false
;
this
.
show
=
true
;
let
param
=
[
{
paramKey
:
"
smtp.host
"
,
paramValue
:
this
.
formInline
.
host
,
type
:
"
text
"
,
sort
:
1
},
{
paramKey
:
"
smtp.port
"
,
paramValue
:
this
.
formInline
.
port
,
type
:
"
text
"
,
sort
:
2
},
{
paramKey
:
"
smtp.account
"
,
paramValue
:
this
.
formInline
.
account
,
type
:
"
text
"
,
sort
:
3
},
{
paramKey
:
"
smtp.password
"
,
paramValue
:
this
.
formInline
.
password
,
type
:
"
password
"
,
sort
:
4
},
{
paramKey
:
"
smtp.ssl
"
,
paramValue
:
this
.
formInline
.
SSL
,
type
:
"
text
"
,
sort
:
5
},
{
paramKey
:
"
smtp.tls
"
,
paramValue
:
this
.
formInline
.
TLS
,
type
:
"
text
"
,
sort
:
6
},
{
paramKey
:
"
smtp.smtp
"
,
paramValue
:
this
.
formInline
.
SMTP
,
type
:
"
text
"
,
sort
:
7
}
]
this
.
$refs
[
formInline
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
result
=
this
.
$post
(
"
/system/edit/email
"
,
param
,
response
=>
{
let
flag
=
response
.
success
;
if
(
flag
)
{
this
.
$success
(
this
.
$t
(
'
commons.save_success
'
));
}
else
{
this
.
$message
.
error
(
this
.
$t
(
'
commons.save_failed
'
));
}
});
}
else
{
return
false
;
}
})
},
cancel
()
{
this
.
query
();
this
.
showEdit
=
true
;
this
.
showCancel
=
false
;
this
.
showSave
=
false
;
this
.
show
=
true
;
this
.
change
()
}
}
}
...
...
frontend/src/business/components/settings/system/User.vue
浏览文件 @
6cf137f7
...
...
@@ -9,7 +9,7 @@
<el-table
:data=
"tableData"
style=
"width: 100%"
>
<el-table-column
prop=
"id"
label=
"ID"
/>
<el-table-column
prop=
"name"
:label=
"$t('commons.
user
name')"
width=
"200"
/>
<el-table-column
prop=
"name"
:label=
"$t('commons.name')"
width=
"200"
/>
<el-table-column
:label=
"$t('commons.role')"
width=
"120"
>
<
template
v-slot:default=
"scope"
>
<ms-roles-tag
:roles=
"scope.row.roles"
/>
...
...
@@ -162,7 +162,7 @@
</el-dialog>
<!--Modify user information in system settings-->
<el-dialog
:title=
"$t('user.modify')"
:visible.sync=
"updateVisible"
width=
"3
0
%"
:destroy-on-close=
"true"
<el-dialog
:title=
"$t('user.modify')"
:visible.sync=
"updateVisible"
width=
"3
5
%"
:destroy-on-close=
"true"
@
close=
"handleClose"
>
<el-form
:model=
"form"
label-position=
"right"
label-width=
"120px"
size=
"small"
:rules=
"rule"
ref=
"updateUserForm"
>
<el-form-item
label=
"ID"
prop=
"id"
>
...
...
frontend/src/business/components/track/case/components/TestCaseEdit.vue
浏览文件 @
6cf137f7
...
...
@@ -355,6 +355,13 @@
this
.
$success
(
this
.
$t
(
'
commons.save_success
'
));
if
(
this
.
operationType
==
'
add
'
&&
this
.
isCreateContinue
)
{
this
.
form
.
name
=
''
;
this
.
form
.
prerequisite
=
''
;
this
.
form
.
steps
=
[{
num
:
1
,
desc
:
''
,
result
:
''
}];
this
.
form
.
remark
=
''
;
this
.
$emit
(
"
refresh
"
);
return
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录