diff --git a/frontend/config/vite.config.dev.ts b/frontend/config/vite.config.dev.ts index fd41da72ef..e7ddff02fc 100644 --- a/frontend/config/vite.config.dev.ts +++ b/frontend/config/vite.config.dev.ts @@ -13,38 +13,38 @@ export default mergeConfig( }, proxy: { '/ws': { - target: 'http://192.168.8.200:8081/', + target: 'http://172.16.200.18:8081/', changeOrigin: true, rewrite: (path: string) => path.replace(/^\/front\/ws/, ''), ws: true, }, '/front': { - target: 'http://192.168.8.200:8081/', + target: 'http://172.16.200.18:8081/', changeOrigin: true, rewrite: (path: string) => path.replace(/^\/front/, ''), }, '/file': { - target: 'http://192.168.8.200:8081/', + target: 'http://172.16.200.18:8081/', changeOrigin: true, rewrite: (path: string) => path.replace(/^\/front\/file/, ''), }, '/attachment': { - target: 'http://192.168.8.200:8081/', + target: 'http://172.16.200.18:8081/', changeOrigin: true, rewrite: (path: string) => path.replace(/^\/front\/attachment/, ''), }, '/bug/attachment': { - target: 'http://192.168.8.200:8081/', + target: 'http://172.16.200.18:8081/', changeOrigin: true, rewrite: (path: string) => path.replace(/^\/front\/bug\/attachment/, ''), }, '/plugin/image': { - target: 'http://192.168.8.200:8081/', + target: 'http://172.16.200.18:8081/', changeOrigin: true, rewrite: (path: string) => path.replace(/^\/front\/plugin\/image/, ''), }, '/base-display': { - target: 'http://192.168.8.200:8081/', + target: 'http://172.16.200.18:8081/', changeOrigin: true, rewrite: (path: string) => path.replace(/^\/front\/base-display/, ''), }, diff --git a/frontend/src/views/api-test/scenario/components/common/customApiDrawer.vue b/frontend/src/views/api-test/scenario/components/common/customApiDrawer.vue index 045de4908e..5044e6a879 100644 --- a/frontend/src/views/api-test/scenario/components/common/customApiDrawer.vue +++ b/frontend/src/views/api-test/scenario/components/common/customApiDrawer.vue @@ -322,6 +322,7 @@ RequestConditionProcessor, RequestMethods, ResponseComposition, + ScenarioStepRefType, ScenarioStepType, } from '@/enums/apiEnum'; @@ -1065,36 +1066,36 @@ ) { await initQuoteApiDetail(); } - // TODO: 类型报错 - // if ( - // props.requestType === ScenarioStepType.QUOTE_API && - // props.request.request && - // requestVModel.value.request - // ) { - // // 初始化引用的详情后,需要要把外面传入的数据的请求头、请求体、query、rest里面的参数值写入 - // ['headers', 'query', 'rest'].forEach((type) => { - // props.request.request[type]?.forEach((item) => { - // const index = requestVModel.value.request[type]?.findIndex((itemReq) => itemReq.key === item.key); - // if (index > -1) { - // requestVModel.value.request[type][index].value = item.value; - // requestVModel.value[type] = requestVModel.value.request[type]; - // } - // }); - // }); - // if (props.request.request.body.bodyType !== 'NONE') { - // ['formDataBody', 'wwwFormBody'].forEach((type) => { - // props.request.request.body[type].formValues.forEach((item) => { - // const index = requestVModel.value.request.body[type].formValues.findIndex( - // (itemReq) => itemReq.key === item.key - // ); - // if (index > -1) { - // requestVModel.value.request.body[type]?.formValues[index].value = item.value; - // requestVModel.value.body = requestVModel.value.request?.body; - // } - // }); - // }); - // } - // } + if ( + props.step?.stepType === ScenarioStepType.API && + props.step?.refType === ScenarioStepRefType.REF && + props.request.request && + requestVModel.value.request + ) { + // 初始化引用的详情后,需要要把外面传入的数据的请求头、请求体、query、rest里面的参数值写入 + ['headers', 'query', 'rest'].forEach((type) => { + props.request?.request?.[type]?.forEach((item) => { + const index = requestVModel.value.request?.[type]?.findIndex((itemReq) => itemReq.key === item.key); + if (index > -1 && requestVModel.value.request) { + requestVModel.value.request[type][index].value = item.value; + requestVModel.value[type] = requestVModel.value.request?.[type]; + } + }); + }); + if (props.request.request.body.bodyType !== 'NONE') { + ['formDataBody', 'wwwFormBody'].forEach((type) => { + props.request?.request?.body[type].formValues.forEach((item) => { + const index = requestVModel.value.request?.body[type].formValues.findIndex( + (itemReq) => itemReq.key === item.key + ); + if (index > -1 && requestVModel.value.request?.body) { + requestVModel.value.request.body[type].formValues[index].value = item.value; + requestVModel.value.body = requestVModel.value.request?.body; + } + }); + }); + } + } handleActiveDebugProtocolChange(requestVModel.value.protocol); } else { requestVModel.value = cloneDeep({ diff --git a/frontend/src/views/api-test/scenario/components/common/customCaseDrawer.vue b/frontend/src/views/api-test/scenario/components/common/customCaseDrawer.vue index 9f7db3b7d3..7ed1145fd7 100644 --- a/frontend/src/views/api-test/scenario/components/common/customCaseDrawer.vue +++ b/frontend/src/views/api-test/scenario/components/common/customCaseDrawer.vue @@ -10,7 +10,7 @@ @close="handleClose" >