feat(接口测试): 去除接口定义路径结尾空格

--bug=1033406 --user=宋昌昌 [接口测试]github#27838接口测试-接口定义,当接口路径最后有空格时,不会自动删除,会拼接到接口上 https://www.tapd.cn/55049933/s/1446804
This commit is contained in:
song-cc-rock 2023-12-21 13:57:21 +08:00 committed by 刘瑞斌
parent 7b0364f018
commit 8f617203b6
1 changed files with 11 additions and 8 deletions

View File

@ -57,20 +57,20 @@
</template>
<script>
import { updateDefinition } from '@/api/definition';
import { getMaintainer } from '@/api/project';
import {updateDefinition} from '@/api/definition';
import {getMaintainer} from '@/api/project';
import MsEditCompleteHttpApi from './complete/EditCompleteHTTPApi';
import MsEditCompleteTcpApi from './complete/EditCompleteTCPApi';
import MsEditCompleteDubboApi from './complete/EditCompleteDubboApi';
import MsEditCompleteSqlApi from './complete/EditCompleteSQLApi';
import { Body } from '../model/ApiTestModel';
import { getUUID } from 'metersphere-frontend/src/utils';
import { handleCtrlSEvent } from '@/api/base-network';
import { createComponent, Request } from './jmeter/components';
import {Body} from '../model/ApiTestModel';
import {getUUID} from 'metersphere-frontend/src/utils';
import {handleCtrlSEvent} from '@/api/base-network';
import {createComponent, Request} from './jmeter/components';
import Sampler from './jmeter/components/sampler/sampler';
import { TYPE_TO_C } from '@/business/automation/scenario/Setting';
import { useApiStore } from '@/store';
import {TYPE_TO_C} from '@/business/automation/scenario/Setting';
import {useApiStore} from '@/store';
const store = useApiStore();
export default {
@ -334,6 +334,8 @@ export default {
this.sort(this.request.hashTree);
},
setParameter(data) {
// Path
data.path = data.path.trimEnd();
data.name = this.currentApi.name;
data.moduleId = this.currentApi.moduleId;
data.modulePath = this.currentApi.modulePath;
@ -431,6 +433,7 @@ export default {
setParameters(data) {
data.projectId = this.projectId;
this.request.name = this.currentApi.name;
this.request.path = this.currentApi.path.trimEnd();
data.protocol = this.currentProtocol;
data.request = this.request;
data.request.name = data.name;