nili 5 months ago
parent
commit
1eda46b215
  1. 2
      game-web/src/main/java/awesome/group/game/web/rest/matrix/AdminController.java

2
game-web/src/main/java/awesome/group/game/web/rest/matrix/AdminController.java

@ -47,6 +47,8 @@ public class AdminController {
MatrixAdmin data = adminService.login(name, pwd, RequestContext.getRequestChannel()); MatrixAdmin data = adminService.login(name, pwd, RequestContext.getRequestChannel());
String token = JwtUtils.generatorToken(data.getId() + "", 15 * 86400); String token = JwtUtils.generatorToken(data.getId() + "", 15 * 86400);
Cookie cookie = new Cookie("MatrixToken", token); Cookie cookie = new Cookie("MatrixToken", token);
cookie.setHttpOnly(false);
cookie.setPath("/");
RequestContext.getResponse().addCookie(cookie); RequestContext.getResponse().addCookie(cookie);
return new R<>(R.CODE_SUCCESS, "ok", null); return new R<>(R.CODE_SUCCESS, "ok", null);
} }

Loading…
Cancel
Save