Commit a8ab0bb8 authored by 智勇's avatar 智勇
parents 7166433f 64579dde
...@@ -88,13 +88,14 @@ admin.post('/add_new_proxy', function (req, res) { ...@@ -88,13 +88,14 @@ admin.post('/add_new_proxy', function (req, res) {
// "http_port": http_port, // "http_port": http_port,
// "https_port": https_port // "https_port": https_port
// } // }
console.log(request)
if(sourcestr != undefined){ if(sourcestr != undefined){
var items = sourcestr.split("|"); var items = sourcestr.split("|");
if(items[1] == request["ip"]){ if(items[1] == request["ip"]){
res.send({msg:"已经存在的配置"}); res.send({msg:"已经存在的配置"});
return return
}else{ }else{
console.log("update new")
targetstr = request["namespace"] + "|" + request["ip"] + "|" + request["proxy_ports"]["http_port"]+ "|" + request["proxy_ports"]["https_port"]; targetstr = request["namespace"] + "|" + request["ip"] + "|" + request["proxy_ports"]["http_port"]+ "|" + request["proxy_ports"]["https_port"];
newstr = str.replace(sourcestr,targetstr); newstr = str.replace(sourcestr,targetstr);
} }
...@@ -103,6 +104,7 @@ admin.post('/add_new_proxy', function (req, res) { ...@@ -103,6 +104,7 @@ admin.post('/add_new_proxy', function (req, res) {
return return
} }
}else{ }else{
console.log("add new")
newstr = str + " " + request["namespace"] + "|" + request["ip"] + "|" + request["proxy_ports"]["http_port"]+ "|" + request["proxy_ports"]["https_port"]; newstr = str + " " + request["namespace"] + "|" + request["ip"] + "|" + request["proxy_ports"]["http_port"]+ "|" + request["proxy_ports"]["https_port"];
//文件添加到这里面 //文件添加到这里面
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment