From e5143e3125179220831f449c03e459b49f571f3b Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 18 Apr 2019 17:19:53 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=96=87=E6=A1=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- class/core/site_api.py | 12 ++++++++++++ route/static/app/site.js | 31 ++++++++++--------------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/class/core/site_api.py b/class/core/site_api.py index 6da6e6ff9..286d68a30 100755 --- a/class/core/site_api.py +++ b/class/core/site_api.py @@ -1178,6 +1178,18 @@ class site_api: data.insert(0, {"id": 0, "name": "默认分类"}) return public.getJson(data) + def getSiteDocApi(self): + stype = request.form.get('type', '0').strip().encode('utf-8') + vlist = [] + vlist.append('') + vlist.append(public.getServerDir()+'/openresty/nginx/html/index.html') + vlist.append(public.getServerDir()+'/openresty/nginx/html/404.html') + vlist.append(public.getServerDir()+'/openresty/nginx/html/index.html') + vlist.append(public.getServerDir()+'/web_conf/stop/index.html') + data = {} + data['path'] = vlist[int(stype)] + return public.returnJson(True, 'ok', data) + def addSiteTypeApi(self): name = request.form.get('name', '').strip().encode('utf-8') if not name: diff --git a/route/static/app/site.js b/route/static/app/site.js index f9464f3bb..b1e9ea4a0 100755 --- a/route/static/app/site.js +++ b/route/static/app/site.js @@ -2060,32 +2060,21 @@ function siteDefaultPage(){ content: '
\ \ \ - \ - \ + \ + \
' }); } function changeDefault(type){ - var vhref=''; - switch(type){ - case 1: - vhref = '/www/server/panel/data/defaultDoc.html'; - break; - case 2: - vhref = '/www/server/panel/data/404.html'; - break; - case 3: - vhref = '/www/server/nginx/html/index.html'; - break; - case 4: - vhref = '/www/server/apache/htdocs/index.html'; - break; - case 5: - vhref = '/www/server/stop/index.html'; - break; - } - onlineEditFile(0,vhref); + $.post('/site/get_site_doc','type='+type, function(rdata){ + showMsg('操作成功!',function(){ + if (rdata.status){ + vhref = rdata.data.path; + onlineEditFile(0,vhref); + } + },{icon:rdata.status?1:2}); + },'json'); }