From 6f507a88aaa6ba13c6cd20be81e4486b843f8a9d Mon Sep 17 00:00:00 2001 From: LiJun <LiJun@192.168.10.20> Date: 星期四, 15 十一月 2018 11:40:32 +0800 Subject: [PATCH] 在跨域请求中添加key识别判断,判断不通过则返回校验失败 <--------------------跨域访问-------------------------------> --- gx_tieta/src/com/fgkj/actions/BattInfAction.java | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/gx_tieta/src/com/fgkj/actions/BattInfAction.java b/gx_tieta/src/com/fgkj/actions/BattInfAction.java index 40b145a..ee929e1 100644 --- a/gx_tieta/src/com/fgkj/actions/BattInfAction.java +++ b/gx_tieta/src/com/fgkj/actions/BattInfAction.java @@ -2,6 +2,8 @@ import java.util.List; +import javax.servlet.http.HttpServletResponse; + import com.fgkj.dao.impl.BattInfImpl; import com.fgkj.dto.BattInf; import com.fgkj.dto.Batt_Maint_Dealarm; @@ -367,6 +369,29 @@ result = ActionUtil.tojson(model); return SUCCESS; } + //棣栭〉涓婃牴鎹畇tationid鏌ヨ鐢垫睜缁勭殑鏈哄巻鍗� + public String serchBattAllInfoByStationId(){ + BattInf binf=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class); + ServiceModel model = service.serchBattAllInfoByStationId(binf); + result = ActionUtil.tojson(model); + return SUCCESS; + } + + //璺ㄥ煙璁块棶鑾峰彇鎵�鏈夌數姹犵粍鐨勪俊鎭�<-------璺ㄥ煙-----------> + public String searchInform_ky(){ + isAllowHeaders(); //鍏佽璺ㄥ煙璁块棶 + //System.out.println(key+"@@@@@@@@@@@@@@@@@@@@@@"); + ServiceModel model = new ServiceModel(); + if(key != null && CROSS_DOMAIN_KEY.equals(key)){ + model = service.searchInform_ky(); + }else{ + model.setCode(0); + model.setMsg("璇嗗埆鐮侀敊璇�"); + } + result = ActionUtil.tojson(model); + return SUCCESS; + } + public BattInf getBif() { return bif; } -- Gitblit v1.9.1