From ccc31de2d2b5d545e9352b1f2d0127672621a6c2 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 29 Jun 2022 02:22:43 +0800 Subject: [PATCH] =?UTF-8?q?openresty=E4=B8=B0=E5=AF=8C=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/openresty/index.py | 6 ++++++ plugins/openresty/js/openresty.js | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins/openresty/index.py b/plugins/openresty/index.py index dfb88ee73..67d905fc8 100755 --- a/plugins/openresty/index.py +++ b/plugins/openresty/index.py @@ -209,6 +209,12 @@ def status(): def restyOp(method): file = initDreplace() + # 启动时,先检查一下配置文件 + check = getServerDir() + "/bin/openresty -t" + check_data = mw.execShell(check) + if check_data[1].find('test failed') != -1: + return check_data[1] + if not mw.isAppleSystem(): data = mw.execShell('systemctl ' + method + ' openresty') if data[1] == '': diff --git a/plugins/openresty/js/openresty.js b/plugins/openresty/js/openresty.js index 535e91e9e..051e35963 100755 --- a/plugins/openresty/js/openresty.js +++ b/plugins/openresty/js/openresty.js @@ -97,12 +97,12 @@ function orPluginOpServiceOp(a,b,c,d,a,v){ } if( g.status && g.data != 'ok' ) { - layer.msg(g.data, {icon: 2,time: 3000,shade: 0.3,shadeClose: true}); + layer.msg(g.data, {icon: 2,time: 10000,shade: 0.3}); } - setTimeout(function(){ - location.reload(); - },2000); + // setTimeout(function(){ + // location.reload(); + // },2000); },'json').error(function() { layer.close(e); layer.msg('操作异常!', {icon: 2});