Commit 302b4089 authored by eddie.woo's avatar eddie.woo

modify

parent cc888f21
......@@ -30,12 +30,18 @@ public class IndexController {
public String login(@CookieValue(value = "AtmsApiToken", required = false) String atmsApiToken,
@CookieValue(value = "LtpaToken", required = false) String ltpaToken,
HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
try {
System.out.println("------ " + JSON.toJSONString(request.getCookies()) + " --------");
} catch (Exception e) {
e.printStackTrace();
}
if (StringUtils.hasText(atmsApiToken)) {
return "index";
} else if (StringUtils.hasText(ltpaToken)) {
String user = LtpaToken.validate(ltpaToken);
if (StringUtils.isEmpty(user)) return "redirect:Account/LogOn";
else {
if (StringUtils.isEmpty(user)) {
return "redirect:Account/LogOn";
} else {
AtmsTokenDto token = new AtmsTokenDto();
String accessToken = jwtUtil.generateToken(user, user, user);
token.setAccess_token(accessToken);
......
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