fix: python脚本无法使用

This commit is contained in:
chenjianxing 2021-01-04 19:15:16 +08:00
parent 45d0a6515e
commit e7d489a469
5 changed files with 9 additions and 10 deletions

View File

@ -35,7 +35,7 @@
ref="codeEdit"/>
</el-col>
<el-col :span="4" class="script-index">
<ms-dropdown :default-command="jsr223ProcessorData.language" :commands="languages" @command="languageChange"/>
<ms-dropdown :default-command="jsr223ProcessorData.scriptLanguage" :commands="languages" @command="languageChange"/>
<div class="template-title">{{$t('api_test.request.processor.code_template')}}</div>
<div v-for="(template, index) in codeTemplates" :key="index" class="code-template">
<el-link :disabled="template.disabled" @click="addTemplate(template)">{{template.title}}</el-link>
@ -135,7 +135,7 @@
this.jsr223ProcessorData.script = "";
}
this.jsr223ProcessorData.script += template.value;
if (this.jsr223ProcessorData.language === 'beanshell') {
if (this.jsr223ProcessorData.scriptLanguage === 'beanshell') {
this.jsr223ProcessorData.script += ';';
}
this.reload();
@ -151,7 +151,7 @@
this.$nextTick(() => (this.isCodeEditAlive = true));
},
languageChange(language) {
this.jsr223ProcessorData.language = language;
this.jsr223ProcessorData.scriptLanguage = language;
},
changeActive() {
this.jsr223ProcessorData.active = !this.jsr223ProcessorData.active;

View File

@ -15,7 +15,7 @@ export default class JSR223PostProcessor extends PostProcessor {
constructor(options = DEFAULT_OPTIONS) {
super(options);
this.type = "JSR223PostProcessor";
this.scriptLanguage = "java";
this.scriptLanguage = "beanshell";
this.parameters = [];
this.filename = undefined;
this.cacheKey = true;

View File

@ -15,7 +15,7 @@ export default class JSR223PreProcessor extends PostProcessor {
constructor(options = DEFAULT_OPTIONS) {
super(options);
this.type = "JSR223PreProcessor";
this.scriptLanguage = "java";
this.scriptLanguage = "beanshell";
this.parameters = [];
this.filename = undefined;
this.cacheKey = undefined;

View File

@ -34,7 +34,7 @@
ref="codeEdit"/>
</el-col>
<el-col :span="4" class="script-index">
<ms-dropdown :default-command="jsr223ProcessorData.language" :commands="languages" @command="languageChange"/>
<ms-dropdown :default-command="jsr223ProcessorData.scriptLanguage" :commands="languages" @command="languageChange"/>
<div class="template-title">{{$t('api_test.request.processor.code_template')}}</div>
<div v-for="(template, index) in codeTemplates" :key="index" class="code-template">
<el-link :disabled="template.disabled" @click="addTemplate(template)">{{template.title}}</el-link>
@ -140,7 +140,7 @@
this.jsr223ProcessorData.script = "";
}
this.jsr223ProcessorData.script += template.value;
if (this.jsr223ProcessorData.language === 'beanshell') {
if (this.jsr223ProcessorData.scriptLanguage === 'beanshell') {
this.jsr223ProcessorData.script += ';';
}
this.reload();
@ -156,7 +156,7 @@
this.$nextTick(() => (this.isCodeEditAlive = true));
},
languageChange(language) {
this.jsr223ProcessorData.language = language;
this.jsr223ProcessorData.scriptLanguage = language;
},
changeActive() {
this.active = !this.active;

View File

@ -842,8 +842,7 @@ export class JSR223Processor extends BaseConfig {
this.active = false;
this.type = "JSR223Processor";
this.script = undefined;
this.language = "beanshell";
this.scriptLanguage = "java";
this.scriptLanguage = "beanshell";
this.enable = true;
this.hashTree = [];
this.set(options);