From 63edf14b8f10cdfcdab9bbfcb58c28125290b9b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=A5=E6=B5=B7?= Date: Tue, 26 Dec 2023 21:03:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=81=E8=AE=B8=E4=B8=8D=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E8=A7=A3=E9=87=8A=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/script/create.vue | 9 +-------- src/apps/script/update.vue | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) 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 { - +