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 |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 59 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/hxzkoa/controller/LoginController.java b/src/main/java/com/hxzkoa/controller/LoginController.java
index 49fc190..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,6 +79,7 @@
 			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());
@@ -232,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")) {
@@ -256,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