From 43b5219e4f3365f7e658041a4191bdcdd47bb624 Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 11 Nov 2019 16:21:41 +0800 Subject: [PATCH] 11/11 report --- src/main/java/login/controller/Member.java | 9 ++++++++- target/classes/login/controller/Member.class | Bin 19955 -> 20045 bytes 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/login/controller/Member.java b/src/main/java/login/controller/Member.java index 277fd53..cd6e267 100644 --- a/src/main/java/login/controller/Member.java +++ b/src/main/java/login/controller/Member.java @@ -271,6 +271,12 @@ public String loginAPI(Model model, HttpServletRequest request, HttpServletRespo if (mb != null) { // OK, 登入成功, 將mb物件放入Session範圍內,識別字串為"LoginOK" session.setAttribute("LoginOK", mb); + // **********for chat use**************************** + Cookie cookieName = null; + cookieName = new Cookie("name", mb.getName()); + cookieName.setMaxAge(7 * 24 * 60 * 60); // Cookie的存活期: 七天 + cookieName.setPath(request.getContextPath()); + response.addCookie(cookieName); // MemberBean mb1 = (MemberBean) session.getAttribute("LoginOK"); } else { // NG, 登入失敗, userid與密碼的組合錯誤,放相關的錯誤訊息到 errorMsgMap 之內 @@ -327,6 +333,7 @@ public String loginAPI(Model model, HttpServletRequest request, HttpServletRespo // OK, 登入成功, 將mb物件放入Session範圍內,識別字串為"LoginOK" status.put("status", "LoginOk"); // MemberBean mb1 = (MemberBean) session.getAttribute("LoginOK"); + } else { // NG, 登入失敗, userid與密碼的組合錯誤,放相關的錯誤訊息到 errorMsgMap 之內 status.put("status", "LoginFail"); @@ -576,7 +583,7 @@ public String updatePicAPI(Model model, HttpServletRequest request, HttpServletR while (-1 != (length = is.read(b))) { fos2.write(b, 0, length); } - + Timestamp ts = new java.sql.Timestamp(System.currentTimeMillis()); mb.setMemberImage(filename); diff --git a/target/classes/login/controller/Member.class b/target/classes/login/controller/Member.class index 39bffb5904c351720c8b10e308463e8c67a110e9..43b569078d33523c53928932701017c99141ba3a 100644 GIT binary patch delta 6350 zcmai22Y6J~v!9up-FtWUCM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