kgdxpr 3 years ago
commit 5ce0e48b06

@ -18,13 +18,6 @@ import java.util.Map;
public class IsLoginInterceptor implements Interceptor {
@Override
public void intercept(Invocation inv) {
// //增加IP范围检查在合法的范围内就放行即可 2022-12-09
// boolean flag = CommonUtil.checkAllowIpAddress(inv.getController().getRequest());
// if(flag) {
// inv.invoke();
// return;
// }
//正常的登录验证逻辑代码
IsLoginInterface annotation = inv.getMethod().getAnnotation(IsLoginInterface.class);
if (annotation != null) {
@ -41,32 +34,10 @@ public class IsLoginInterceptor implements Interceptor {
inv.invoke();
}
//1、读取cookie,获取所有本域下的配置值
boolean isTrue;
boolean isTrue = false;
if ((con.getCookie("toupiaoren_tel"))==null || (con.getCookie("person_id") == null) || (con.getCookie("bureau_id") == null) ||
(con.getCookie("identity_id") == null || (con.getCookie("org_code") == null))) {
isTrue = false;
} else {
Map loginMap = new HashMap<String, String>();
loginMap.put("identity_id", con.getCookie("identity_id"));
loginMap.put("person_id", con.getCookie("person_id"));
loginMap.put("bureau_id", con.getCookie("bureau_id"));
loginMap.put("org_code", con.getCookie("org_code"));
//2、根据cookie中获取到的map得到一个 share
String token = CommonUtil.Sign(loginMap, PropKit.get("CookieMd5SingPwd"));
//3、与cookie中的token进行对比
if (token.equals(con.getCookie("token"))) {
isTrue = true;
} else {
//清空cookie
con.setCookie("bureau_id", null, 0, true);
con.setCookie("identity_id", null, 0, true);
con.setCookie("person_id", null, 0, true);
con.setCookie("org_code", null, 0, true);
con.setCookie("token", null, 0, true);
isTrue = false;
}
if ((con.getCookie("toupiaoren_tel")) != null || (con.getCookie("person_id") != null)) {
isTrue = true;
}
if (isTrue) {
inv.invoke();

@ -32,12 +32,15 @@ public class TouPiaoController extends Controller {
renderJson(CommonUtil.renderJsonForLayUI(list));
}
/*
,
http://10.10.11.124:9000/FengHuang/TouPiao/getTouPiaoRenInfo
*/
@Before({GET.class})
@IsLoginInterface({})
public void getTouPiaoRenInfo() {
String toupiaoren_tel = getCookie("toupiaoren_tel");
String sql = "select * from t_toupiao_toupiaoren where toupiaoren_tel=?";
List<Record> list = Db.find(sql, toupiaoren_tel);
List<Record> list = tm.getTouPiaoRenInfo(toupiaoren_tel);
renderJson(CommonUtil.renderJsonForLayUI(list));
}
}

@ -21,4 +21,9 @@ public class TouPiaoModel {
String sql = "select * from t_toupiao_houxuanren where houxuanren_type_id=?";
return Db.find(sql, type_id);
}
public List<Record> getTouPiaoRenInfo(String toupiaoren_tel) {
String sql = "select * from t_toupiao_toupiaoren where toupiaoren_tel=?";
return Db.find(sql, toupiaoren_tel);
}
}
Loading…
Cancel
Save