Commit 64579dde authored by tywldx's avatar tywldx

f

parent 04f97d03
......@@ -88,13 +88,14 @@ admin.post('/add_new_proxy', function (req, res) {
// "http_port": http_port,
// "https_port": https_port
// }
console.log(request)
if(sourcestr != undefined){
var items = sourcestr.split("|");
if(items[1] == request["ip"]){
res.send({msg:"已经存在的配置"});
return
}else{
console.log("update new")
targetstr = request["namespace"] + "|" + request["ip"] + "|" + request["proxy_ports"]["http_port"]+ "|" + request["proxy_ports"]["https_port"];
newstr = str.replace(sourcestr,targetstr);
}
......@@ -103,6 +104,7 @@ admin.post('/add_new_proxy', function (req, res) {
return
}
}else{
console.log("add new")
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