Commit ef099b00 by 雷紫添

添加ip授权

parent 2eb92ecc
......@@ -17,7 +17,8 @@ public class IpADressLock {
private String ftpserverip;
@Value(value = "${ftpfilePath}")
private String ftpfilePath;
@Value(value = "${ipaddress}")
private String ipaddress;
public boolean getIpAddress(HttpServletRequest request) {
String ip = request.getHeader("x-forwarded-for");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
......@@ -37,7 +38,7 @@ public class IpADressLock {
}
RestTemplate restTemplate = new RestTemplate();
String result =restTemplate.getForObject("http://"+ftpserverip+ftpfilePath+"/GA_D_RSDDM.js",String.class);
String result =restTemplate.getForObject("http://"+ftpserverip+ftpfilePath+ipaddress+".js",String.class);
List<IpADdress> resultList= JSONArray.parseArray(result,IpADdress.class);
......
......@@ -23,6 +23,7 @@ ftppass: p@ssw0rd[123]
ftpbathPath: /home/ftpuser/www/neimeng/FZXZ
ftpfilePath: /neimeng/FZXZ
redistimeout: 60000
ipaddress: /IP_ADDRESS
codemsg:
status:
- code: "10101"
......
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