fix(接口测试): 兼容旧版本beanshell

This commit is contained in:
chenjianxing 2020-09-03 13:28:46 +08:00
parent 9f9210bb87
commit 306773ddcd
2 changed files with 8 additions and 3 deletions

View File

@ -82,6 +82,11 @@
default: false
}
},
watch: {
jsr223Processor() {
this.reload();
}
},
methods: {
addTemplate(template) {
if (!this.jsr223Processor.script) {

View File

@ -8,7 +8,7 @@
</template>
<script>
import {Request, RequestFactory, Scenario} from "../../model/ScenarioModel";
import {JSR223Processor, Request, RequestFactory, Scenario} from "../../model/ScenarioModel";
import MsApiHttpRequestForm from "./ApiHttpRequestForm";
import MsApiDubboRequestForm from "./ApiDubboRequestForm";
import MsScenarioResults from "../../../report/components/ScenarioResults";
@ -58,10 +58,10 @@ export default {
mounted() {
// beanshell
if (!this.request.jsr223PreProcessor.script && this.request.beanShellPreProcessor) {
this.request.jsr223PreProcessor = this.request.beanShellPreProcessor;
this.request.jsr223PreProcessor = new JSR223Processor(this.request.beanShellPreProcessor);
}
if (!this.request.jsr223PostProcessor.script && this.request.beanShellPostProcessor) {
this.request.jsr223PostProcessor = this.request.beanShellPostProcessor;
this.request.jsr223PostProcessor = new JSR223Processor(this.request.beanShellPostProcessor);
}
},
methods: {