Merge pull request #710 from jd82k/master

fix bugs
pull/720/head
Mr Chen 3 months ago committed by GitHub
commit 1328699da0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      web/static/app/site.js
  2. 2
      web/utils/site.py

@ -1551,7 +1551,7 @@ function to301(siteName, type, obj){
if (res.status) {
var data = res.data.result;
data.forEach(function(item){
var lan_r_type = item.r_type == 0 ? "永久重定向" : "临时重定向";
var lan_r_type = item.r_type == 0 ? "临时重定向" : "永久重定向";
var keep_path = item.keep_path == 0 ? "不保留" : "保留";
var switchProxy = '<span onclick="toRedirect(\''+siteName+'\',\''+ item.id +'\',10)" style="color:rgb(92, 184, 92);" class="btlink glyphicon glyphicon-play"></span>';
@ -3248,4 +3248,4 @@ function tryRestartPHP(siteName){
layer.msg( 'PHP['+phpversion+']'+(data.status?'重启成功!':'重启失败!'),{icon:data.status?1:2,time:3000,shade: [0.3, '#000']});
},'json');
},'json');
}
}

@ -1376,7 +1376,7 @@ class sites(object):
if _keep_path == 1:
_to = "{}$request_uri".format(to)
redirect_type = "301" if _type_code == 0 else "302"
redirect_type = "301" if _r_type == 0 else "302"
_if = "if ($host ~ '^{}')".format(site_from)
_return = "return {} {}; ".format(redirect_type, to)
file_content = _if + "{\r\n " + _return + "\r\n}"

Loading…
Cancel
Save