From 63a63974524ca348843b490f3822a27e1d289b48 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 7 Mar 2019 18:59:15 +0800 Subject: [PATCH] =?UTF-8?q?php=E5=8D=B8=E8=BD=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/php/index.py | 11 ++++++----- plugins/php/js/php.js | 18 ++++++++++++------ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/plugins/php/index.py b/plugins/php/index.py index abc87266a..57599269c 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -569,11 +569,12 @@ def uninstallLib(version): execstr = "cd " + getPluginDir() + '/versions/' + version + " && /bin/bash " + \ name + '.sh' + ' uninstall ' + version - rettime = time.strftime('%Y-%m-%d %H:%M:%S') - insert_info = (None, '安装[' + name + '-' + version + ']', - 'execshell', '0', rettime, execstr) - public.M('tasks').add('id,name,type,status,addtime,execstr', insert_info) - return public.returnJson(True, '已将卸载载任务添加到队列!') + data = public.execShell(execstr) + if data[1] == '': + return public.returnJson(True, '已经卸载成功!') + else: + return public.returnJson(False, '卸载出现错误信息!' + data[1]) + if __name__ == "__main__": diff --git a/plugins/php/js/php.js b/plugins/php/js/php.js index 869160058..f807ed980 100755 --- a/plugins/php/js/php.js +++ b/plugins/php/js/php.js @@ -508,9 +508,12 @@ function installPHPLib(version, name, title, pathinfo) { phpPost('install_lib', version, data, function(data){ var rdata = $.parseJSON(data.data); - layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 }); - getTaskCount(); - phpLibConfig(version); + // layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 }); + showMsg(rdata.msg, function(){ + getTaskCount(); + phpLibConfig(version); + },{ icon: rdata.status ? 1 : 2 }); + }); }); } @@ -522,9 +525,12 @@ function uninstallPHPLib(version, name, title, pathinfo) { var data = 'name=' + name + '&version=' + version; phpPost('uninstall_lib', version, data, function(data){ var rdata = $.parseJSON(data.data); - layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 }); - getTaskCount(); - phpLibConfig(version); + // layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 }); + showMsg(rdata.msg, function(){ + getTaskCount(); + phpLibConfig(version); + },{ icon: rdata.status ? 1 : 2 }); + }); }); } \ No newline at end of file