Merge branch 'dev' of https://github.com/fit2cloudrd/metersphere-server into dev
This commit is contained in:
commit
8a5a855759
|
@ -25,9 +25,7 @@
|
|||
AND load_test.id = #{request.id}
|
||||
</if>
|
||||
</where>
|
||||
<if test="request.recent">
|
||||
order by load_test.update_time desc
|
||||
</if>
|
||||
order by load_test.update_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -13,4 +13,5 @@ public interface ExtUserMapper {
|
|||
int updatePassword(User record);
|
||||
|
||||
String getDefaultLanguage(String paramKey);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package io.metersphere.controller;
|
||||
|
||||
import io.metersphere.base.domain.UserRole;
|
||||
import io.metersphere.commons.utils.SessionUtils;
|
||||
import io.metersphere.controller.request.LoginRequest;
|
||||
import io.metersphere.dto.UserDTO;
|
||||
import io.metersphere.service.UserService;
|
||||
|
@ -88,7 +89,7 @@ public class LoginController {
|
|||
}
|
||||
|
||||
/*Get default language*/
|
||||
@PostMapping(value = "/language")
|
||||
@GetMapping(value = "/language")
|
||||
public String getDefaultLanguage() {
|
||||
return userService.getDefaultLanguage();
|
||||
}
|
||||
|
|
|
@ -8,13 +8,13 @@ import io.metersphere.base.mapper.ext.ExtLoadTestReportMapper;
|
|||
import io.metersphere.commons.constants.PerformanceTestStatus;
|
||||
import io.metersphere.commons.exception.MSException;
|
||||
import io.metersphere.commons.utils.LogUtil;
|
||||
import io.metersphere.track.request.testplan.*;
|
||||
import io.metersphere.dto.LoadTestDTO;
|
||||
import io.metersphere.i18n.Translator;
|
||||
import io.metersphere.performance.engine.Engine;
|
||||
import io.metersphere.performance.engine.EngineFactory;
|
||||
import io.metersphere.service.FileService;
|
||||
import io.metersphere.service.TestResourceService;
|
||||
import io.metersphere.track.request.testplan.*;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -247,7 +247,6 @@ public class PerformanceTestService {
|
|||
|
||||
public List<LoadTestDTO> recentTestPlans(QueryTestPlanRequest request) {
|
||||
// 查询最近的测试计划
|
||||
request.setRecent(true);
|
||||
return extLoadTestMapper.list(request);
|
||||
}
|
||||
|
||||
|
|
|
@ -346,7 +346,8 @@ public class UserService {
|
|||
}
|
||||
|
||||
public String getDefaultLanguage() {
|
||||
final String key = "registry.defaultlanguage";
|
||||
final String key = "default.language";
|
||||
return extUserMapper.getDefaultLanguage(key);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,5 +7,4 @@ import lombok.Setter;
|
|||
@Setter
|
||||
public class QueryTestPlanRequest extends TestPlanRequest {
|
||||
private String workspaceId;
|
||||
private boolean recent = false; // 表示查询最近的测试
|
||||
}
|
||||
|
|
|
@ -4,10 +4,18 @@ VALUES ('admin', 'Administrator', 'admin@fit2cloud.com', md5('fit2cloud'), '1',
|
|||
INSERT INTO user_role (id, user_id, role_id, source_id, create_time, update_time)
|
||||
VALUES (uuid(), 'admin', 'admin', '1', 1581576575948, 1581576575948);
|
||||
|
||||
INSERT INTO role (id, name, description, type, create_time, update_time) VALUES ('admin', '系统管理员', null, null, 1581576575948, 1581576575948);
|
||||
INSERT INTO role (id, name, description, type, create_time, update_time) VALUES ('org_admin', '组织管理员', null, null, 1581576575948, 1581576575948);
|
||||
INSERT INTO role (id, name, description, type, create_time, update_time) VALUES ('test_manager', '测试经理', null, null, 1581576575948, 1581576575948);
|
||||
INSERT INTO role (id, name, description, type, create_time, update_time) VALUES ('test_user', '测试人员', null, null, 1581576575948, 1581576575948);
|
||||
INSERT INTO role (id, name, description, type, create_time, update_time) VALUES ('test_viewer', 'Viewer', null, null, 1581576575948, 1581576575948);
|
||||
INSERT INTO role (id, name, description, type, create_time, update_time)
|
||||
VALUES ('admin', '系统管理员', NULL, NULL, 1581576575948, 1581576575948);
|
||||
INSERT INTO role (id, name, description, type, create_time, update_time)
|
||||
VALUES ('org_admin', '组织管理员', NULL, NULL, 1581576575948, 1581576575948);
|
||||
INSERT INTO role (id, name, description, type, create_time, update_time)
|
||||
VALUES ('test_manager', '测试经理', NULL, NULL, 1581576575948, 1581576575948);
|
||||
INSERT INTO role (id, name, description, type, create_time, update_time)
|
||||
VALUES ('test_user', '测试人员', NULL, NULL, 1581576575948, 1581576575948);
|
||||
INSERT INTO role (id, name, description, type, create_time, update_time)
|
||||
VALUES ('test_viewer', 'Viewer', NULL, NULL, 1581576575948, 1581576575948);
|
||||
|
||||
INSERT INTO test_case_report_template (id,name,content) VALUES (uuid(), 'default','{\"components\": [1,2,3,4,5]}');
|
||||
INSERT INTO test_case_report_template (id, name, content)
|
||||
VALUES (uuid(), 'default', '{\"components\": [1,2,3,4,5]}');
|
||||
INSERT INTO system_parameter (param_key, param_value, type, sort)
|
||||
VALUES ('default.language', 'zh_CN', 'text', 5);
|
|
@ -24,8 +24,7 @@
|
|||
</ms-api-collapse-item>
|
||||
</ms-api-collapse>
|
||||
</div>
|
||||
<!-- 暂时去掉,将来再加-->
|
||||
<!-- <el-button class="scenario-create" type="primary" size="mini" icon="el-icon-plus" plain @click="createScenario"/>-->
|
||||
<el-button class="scenario-create" type="primary" size="mini" icon="el-icon-plus" plain @click="createScenario"/>
|
||||
</el-aside>
|
||||
|
||||
<el-main class="scenario-main">
|
||||
|
|
|
@ -255,7 +255,7 @@ export class HTTPSamplerProxy extends DefaultTestElement {
|
|||
this.stringProp("HTTPSampler.protocol", this.request.protocol.split(":")[0]);
|
||||
this.stringProp("HTTPSampler.path", this.request.pathname);
|
||||
this.stringProp("HTTPSampler.method", this.request.method);
|
||||
if (this.request.port) {
|
||||
if (!this.request.port) {
|
||||
this.stringProp("HTTPSampler.port", "");
|
||||
} else {
|
||||
this.stringProp("HTTPSampler.port", this.request.port);
|
||||
|
|
|
@ -496,7 +496,7 @@ class JMXGenerator {
|
|||
|
||||
getAssertion(regex) {
|
||||
let name = regex.description;
|
||||
let type = JMX_ASSERTION_CONDITION.MATCH; // 固定用Match,自己写正则
|
||||
let type = JMX_ASSERTION_CONDITION.CONTAINS; // 固定用Match,自己写正则
|
||||
let value = regex.expression;
|
||||
switch (regex.subject) {
|
||||
case ASSERTION_REGEX_SUBJECT.RESPONSE_CODE:
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {EN_US, TokenKey, ZH_CN, ZH_TW} from '../../../../common/js/constants';
|
||||
import {DEFAULT_LANGUAGE, EN_US, TokenKey, ZH_CN, ZH_TW} from '../../../../common/js/constants';
|
||||
import {getCurrentUser} from "../../../../common/js/utils";
|
||||
|
||||
export default {
|
||||
|
@ -38,7 +38,7 @@
|
|||
let lang = this.currentUser().language;
|
||||
this.currentUserInfo = this.currentUser();
|
||||
if (!lang) {
|
||||
lang = 'zh_CN';
|
||||
lang = localStorage.getItem(DEFAULT_LANGUAGE);
|
||||
}
|
||||
this.checkLanguage(lang)
|
||||
},
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export const TokenKey = 'Admin-Token';
|
||||
export const DEFAULT_LANGUAGE = 'default_language';
|
||||
|
||||
export const ROLE_ADMIN = 'admin';
|
||||
export const ROLE_ORG_ADMIN = 'org_admin';
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
|
||||
<script>
|
||||
import {saveLocalStorage} from '../common/js/utils';
|
||||
import {DEFAULT_LANGUAGE} from "../common/js/constants";
|
||||
|
||||
|
||||
export default {
|
||||
|
@ -107,15 +108,16 @@
|
|||
this.$post("signin", this.form, response => {
|
||||
saveLocalStorage(response);
|
||||
let language = response.data.language;
|
||||
|
||||
if (!language) {
|
||||
this.$post("language", response => {
|
||||
language = response.data.language
|
||||
this.$setLang(language);
|
||||
this.$get("language", response => {
|
||||
language = response.data;
|
||||
localStorage.setItem(DEFAULT_LANGUAGE, language)
|
||||
window.location.href = "/"
|
||||
})
|
||||
} else {
|
||||
window.location.href = "/"
|
||||
}
|
||||
|
||||
|
||||
window.location.href = "/"
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue