From 96192f8d7cf444e9e8acbb1dcbdacee227908191 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 26 Feb 2019 15:47:51 +0800 Subject: [PATCH] u --- class/core/system_api.py | 11 +++++++---- route/static/app/index.js | 7 ------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/class/core/system_api.py b/class/core/system_api.py index 7e1e7940c..40d75c941 100755 --- a/class/core/system_api.py +++ b/class/core/system_api.py @@ -665,12 +665,15 @@ class system_api: newUrl = v_new_info['path'] toPath = public.getRootDir() + '/temp' - if os.path.exists(toPath): + if not os.path.exists(toPath): public.execShell('mkdir -p ' + toPath) - public.execShell('wget -O ' + toPath + '/mw.zip ' + newUrl) + if not os.path.exists(toPath + '/mw.zip'): + public.execShell('wget -O ' + toPath + '/mw.zip ' + newUrl) + + public.execShell('unzip -o ' + toPath + '/mw.zip' + ' -d ./') public.execShell('unzip -o mdserver-web.zip -d ./') - # public.execShell('rm -f mdserver-web.zip') + public.execShell('rm -f mdserver-web.zip') return public.returnJson(True, '安装更新成功!') return public.returnJson(False, '已经是最新,无需更新!') @@ -681,7 +684,7 @@ class system_api: # 修复面板 def repPanel(self, get): vp = '' - if public.readFile('/www/server/panel/class/common.py').find('checkSafe') != -1: + if public.readFile('/www/server/mdserver-web/class/common.py').find('checkSafe') != -1: vp = '_pro' public.ExecShell("wget -O update.sh " + public.get_url() + "/install/update" + vp + ".sh && bash update.sh") diff --git a/route/static/app/index.js b/route/static/app/index.js index b19681049..e89dd8b18 100755 --- a/route/static/app/index.js +++ b/route/static/app/index.js @@ -543,10 +543,6 @@ function updateVersion(version) { var loadT = layer.msg('正在升级面板..', { icon: 16, time: 0, shade: [0.3, '#000'] }); $.get('/system/update_server?type=update&version='+version, function(rdata) { - if (rdata.data == 'download'){ - updateStatus();return; - } - layer.closeAll(); if (rdata.status === false) { layer.msg(rdata.msg, { icon: 5, time: 5000 }); @@ -565,7 +561,6 @@ function updateVersion(version) { }); } - function pluginService(pname,pfunc, callback){ $.post('/plugins/run', {name:'openresty', func:pfunc}, function(data) { if (!data.status){ @@ -579,8 +574,6 @@ function pluginService(pname,pfunc, callback){ },'json'); } - - //重启服务器 function reBoot() { layer.open({