Commit ae1d7f45 authored by WeiWei's avatar WeiWei

增加JSESSIONID写入

parent da3d0886
...@@ -13,7 +13,9 @@ import lombok.extern.slf4j.Slf4j; ...@@ -13,7 +13,9 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
/** /**
...@@ -29,6 +31,9 @@ public class LogService { ...@@ -29,6 +31,9 @@ public class LogService {
@Autowired @Autowired
private HttpServletRequest request; private HttpServletRequest request;
@Autowired
private HttpServletResponse response;
/** /**
* 登入 * 登入
* *
...@@ -61,6 +66,12 @@ public class LogService { ...@@ -61,6 +66,12 @@ public class LogService {
session.setAttribute(ApplicationDictionary.PRINCIPAL, JSONTools.serialize(principal)); session.setAttribute(ApplicationDictionary.PRINCIPAL, JSONTools.serialize(principal));
Cookie cookie = new Cookie("JSESSIONID", session.getId());
cookie.setDomain(".vinceruan.info");
cookie.setPath("/");
this.response.addCookie(cookie);
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment