Commit 5958805b authored by suntao's avatar suntao

Merge branch 'v1' of http://git.quantgroup.cn/QG/cash-loan-flow-boss into v1

# By WeiWei
# Via WeiWei
* 'v1' of http://git.quantgroup.cn/QG/cash-loan-flow-boss:
  登录接口有boolean类型改为返回session id
  测试domain
  测试domain
  测试domain
parents a92beb69 891751f9
......@@ -30,7 +30,7 @@ public class LogController {
* @return
*/
@PostMapping("/login")
public Result<Boolean> login(@RequestBody @Valid LoginFormModel loginFormModel) {
public Result<String> login(@RequestBody @Valid LoginFormModel loginFormModel) {
return new Result<>(ApplicationStatus.SUCCESS, this.logService.login(loginFormModel.getUsername(), loginFormModel.getPassword()));
}
......
......@@ -13,9 +13,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/**
......@@ -31,9 +29,6 @@ public class LogService {
@Autowired
private HttpServletRequest request;
@Autowired
private HttpServletResponse response;
/**
* 登入
*
......@@ -41,7 +36,7 @@ public class LogService {
* @param password 密码(明文)
* @return
*/
public boolean login(String username, String password) {
public String login(String username, String password) {
User user = this.userService.getUser(username);
......@@ -66,15 +61,7 @@ public class LogService {
session.setAttribute(ApplicationDictionary.PRINCIPAL, JSONTools.serialize(principal));
// Cookie cookie = new Cookie("JSESSIONID", session.getId());
// log.info("登录客户端IP:{}", request.getRemoteAddr());
// cookie.setHttpOnly(false);
// cookie.setDomain(request.getRemoteAddr());
// cookie.setPath("/");
//
// this.response.addCookie(cookie);
return true;
return session.getId();
}
......
......@@ -18,8 +18,7 @@ public class TomcatConfiguration {
return container -> {
if (container instanceof TomcatEmbeddedServletContainerFactory) {
((TomcatEmbeddedServletContainerFactory) container)
.addContextCustomizers((TomcatContextCustomizer) context -> context.setCookieProcessor(new LegacyCookieProcessor()));
((TomcatEmbeddedServletContainerFactory) container).addContextCustomizers((TomcatContextCustomizer) context -> context.setCookieProcessor(new LegacyCookieProcessor()));
}
};
......
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