From 52cffc4ab8e9787a6f233295502c7c9788dddae1 Mon Sep 17 00:00:00 2001
From: fxl <473369119@qq.com>
Date: 星期二, 07 三月 2023 10:45:17 +0800
Subject: [PATCH] 3.7
---
src/main/java/com/hxzkoa/controller/LoginController.java | 68 ++++++++++++++++++++++++++++++++--
1 files changed, 64 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/hxzkoa/controller/LoginController.java b/src/main/java/com/hxzkoa/controller/LoginController.java
index cc4292b..0148b10 100644
--- a/src/main/java/com/hxzkoa/controller/LoginController.java
+++ b/src/main/java/com/hxzkoa/controller/LoginController.java
@@ -18,6 +18,8 @@
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
+import com.hxzkoa.json.tb_achor;
+import com.hxzkoa.json.tb_login;
import com.hxzkoa.json.tb_system;
import com.hxzkoa.json.tb_user;
import com.hxzkoa.services.LoginService;
@@ -34,6 +36,7 @@
import com.hxzkoa.util.Config;
import com.hxzkoa.util.HttpUtil;
import com.hxzkoa.util.ModifyConfig;
+import com.hxzkoa.util.PageUtil;
import net.sf.json.JSONObject;
@@ -67,6 +70,7 @@
String result = "0";
String db_password = user.getPassword();
if (password.equals(db_password)) {
+// if (true) {
HttpSession session = request.getSession();
ServletContext application = session.getServletContext();
application.setAttribute("username", user.getUsername());
@@ -75,27 +79,29 @@
application.setAttribute("deleteq", user.getDeleteq());
application.setAttribute("alertq", user.getAlertq());
application.setAttribute("deleteall", user.getDeleteall());
+ application.setAttribute("fenceq", user.getFenceq());
session.setAttribute("username", user.getUsername());
session.setAttribute("password", user.getPassword());
session.setAttribute("superuser", user.getSuperuser());
session.setAttribute("deleteq", user.getDeleteq());
session.setAttribute("alertq", user.getAlertq());
session.setAttribute("deleteall", user.getDeleteall());
+ session.setAttribute("fenceq", user.getFenceq());
result = "1";
String username2 = (String) application.getAttribute("username");
- System.out.print(username2);
+ //System.out.print(username2);
// tb_system system = new tb_system();
// system.setUdpPort("8234");
-// System.out.print(system);
+// //System.out.print(system);
// JSONObject jsonObject = JSONObject.fromObject(system);
// String postUrl = Config.getPostUrl();
// String url_setting_bw = postUrl + "getSysSetting.do";
-// System.out.print(url_setting_bw);
+// //System.out.print(url_setting_bw);
// JSONObject re_tb_setting = HttpUtil.doPost(url_setting_bw, jsonObject.toString(), "UTF-8");
// tb_system re_setting = (tb_system) JSONObject.toBean(JSONObject.fromObject(re_tb_setting.get("result").toString()),
// tb_system.class);
-// System.out.print(re_setting);
+// //System.out.print(re_setting);
// String port = re_setting.getUdpPort();
// 寮�鍚姤鏂囨帴鏀�
// try {
@@ -231,12 +237,14 @@
application.removeAttribute("deleteq");
application.removeAttribute("alertq");
application.removeAttribute("deleteall");
+ application.removeAttribute("fenceq");
session.removeAttribute("username");
session.removeAttribute("password");
session.removeAttribute("superuser");
session.removeAttribute("deleteq");
session.removeAttribute("alertq");
session.removeAttribute("deleteall");
+ session.removeAttribute("fenceq");
// 鍋滄鎶ユ枃鎺ユ敹
if (Config.getUdpRunning().equals("1")) {
@@ -255,4 +263,56 @@
}
return "redirect:/hxzk/login.jsp";
}
+
+ @RequestMapping(value = "/loginfa.do", method = { RequestMethod.POST, RequestMethod.GET })
+ public String loginfa(HttpServletRequest request) throws Exception {
+ String toPage = "forward:/hxzk/sysSetting/loginfa.jsp";
+ List<tb_login> logins = loginService.getloginManagement(1);
+ int curPage = 1;
+ int count = loginService.getloginManagementCount();
+ int minPage = PageUtil.getMinPage(count);
+ request.setAttribute("dataList", logins);
+ request.setAttribute("pageList", PageUtil.getPage(minPage));
+ request.setAttribute("curPage", curPage);
+ return toPage;
+ }
+
+ @ResponseBody
+ @RequestMapping(value = "findloginid.do", method = {RequestMethod.POST,RequestMethod.GET})
+ public JSONObject findloginid(HttpServletRequest request) throws Exception {
+ JSONObject json = new JSONObject();
+ String username = request.getParameter("input");
+ List<tb_login> logins = loginService.getloginid(username);
+ json.put("dataList", logins);
+ return json;
+ }
+
+ @ResponseBody
+ @RequestMapping(value = "/loginManagement_page.do", method = { RequestMethod.POST, RequestMethod.GET })
+ public String loginManagement_page(HttpServletRequest request) {
+ String pageStr = request.getParameter("page");
+ String curPageStr = request.getParameter("curPage");
+ int count = loginService.getloginManagementCount();
+ int minPage = PageUtil.getMinPage(count);
+ int curPage = Integer.parseInt(curPageStr);
+ int page = 1;
+ if ("pre".equals(pageStr)) {
+ if (curPage > 1) {
+ page = curPage - 1;
+ }
+ } else if ("next".equals(pageStr)) {
+ if (curPage < minPage) {
+ page = curPage + 1;
+ }
+ } else {
+ page = Integer.parseInt(pageStr);
+ }
+ List<tb_login> loginManagementList = loginService.getloginManagement(page);
+ List<Integer> pageList = PageUtil.getPage(PageUtil.getLocPage(page, curPage), page, minPage);
+ JSONObject json = new JSONObject();
+ json.put("dataList", loginManagementList);
+ json.put("pageList", pageList);
+ json.put("curPage", page);
+ return json.toString();
+ }
}
--
Gitblit v1.10.0