新增 {{py}} 和 {{js}} 两个特殊变量

This commit is contained in:
fofolee
2022-04-10 12:01:22 +08:00
parent 00e94588d5
commit 0cd878adfb
3 changed files with 63 additions and 30 deletions

View File

@@ -119,7 +119,7 @@ export default {
assignSpecialVars(cmd) {
let spVars = _.filter(specialVars, (sp) => sp.repl);
_.forIn(spVars, (val, key) => {
if (cmd.includes(val.label.slice(0, 12))) {
if (cmd.includes(val.label.slice(0, -2))) {
cmd = cmd.replace(val.match, (x) => val.repl(x));
}
});
@@ -180,7 +180,7 @@ export default {
showRunResult(content, isSuccess, action) {
this.isResultShow = true;
this.runResultStatus = isSuccess;
let contlength = content.length;
let contlength = content?.length || 0;
if (contlength > this.resultMaxLength)
content =
content.slice(0, this.resultMaxLength - 100) +