Skip to content

Commit

Permalink
11/11 report
Browse files Browse the repository at this point in the history
  • Loading branch information
ntut-ben committed Nov 11, 2019
1 parent a53ad0b commit 43b5219
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/login/controller/Member.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 之內
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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);
Expand Down
Binary file modified target/classes/login/controller/Member.class
Binary file not shown.

0 comments on commit 43b5219

Please sign in to comment.