diff --git a/src/apps/script/create.vue b/src/apps/script/create.vue index 8cb8279..ee044b7 100644 --- a/src/apps/script/create.vue +++ b/src/apps/script/create.vue @@ -33,10 +33,6 @@ export default class ScriptCreate extends Vue { Api.msg.err('请检查表单'); return false; } - if (this.formModel.CommandType == 'SHELL' && this.formModel.Content.indexOf('#!/') !== 0) { - Api.msg.err('请在首行声明解释器,如 #!/bin/sh'); - return false; - } await NaApi.script.create(this.formModel); this.close(); } @@ -48,9 +44,6 @@ export default class ScriptCreate extends Vue { case 'SHELL': this.formModel.Username = 'root'; this.formModel.WorkDirectory = '/root'; - if (this.formModel.Content.indexOf('#!/') !== 0) { - this.formModel.Content = '#!/bin/sh\n' + this.formModel.Content; - } break; case 'POWERSHELL': case 'BAT': @@ -105,7 +98,7 @@ export default class ScriptCreate extends Vue { - + diff --git a/src/apps/script/update.vue b/src/apps/script/update.vue index 2201bc4..60b38ff 100644 --- a/src/apps/script/update.vue +++ b/src/apps/script/update.vue @@ -33,10 +33,6 @@ export default class ScriptUpdate extends Vue { Api.msg.err('请检查表单'); return false; } - if (this.formModel.CommandType == 'SHELL' && this.formModel.Content.indexOf('#!/') !== 0) { - Api.msg.err('请在首行声明解释器,如 #!/bin/sh'); - return false; - } await NaApi.script.update(this.formModel); this.close(); } @@ -48,9 +44,6 @@ export default class ScriptUpdate extends Vue { case 'SHELL': this.formModel.Username = 'root'; this.formModel.WorkDirectory = '/root'; - if (this.formModel.Content.indexOf('#!/') !== 0) { - this.formModel.Content = '#!/bin/sh\n' + this.formModel.Content; - } break; case 'POWERSHELL': case 'BAT': @@ -97,7 +90,7 @@ export default class ScriptUpdate extends Vue { - +