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'); }