From 459f5590bc904390faf88587cbdcfcb9d07bdd56 Mon Sep 17 00:00:00 2001
From: ZhuDongming <773644075@qq.com>
Date: Thu, 25 Jul 2019 14:45:09 +0800
Subject: [PATCH] 新增显示无人机飞行轨迹地图接口
---
src/main/java/com/moral/security/auth/login/LoginAwareAuthenticationSuccessHandler.java | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/moral/security/auth/login/LoginAwareAuthenticationSuccessHandler.java b/src/main/java/com/moral/security/auth/login/LoginAwareAuthenticationSuccessHandler.java
index 02c6d29..71db7f1 100644
--- a/src/main/java/com/moral/security/auth/login/LoginAwareAuthenticationSuccessHandler.java
+++ b/src/main/java/com/moral/security/auth/login/LoginAwareAuthenticationSuccessHandler.java
@@ -1,6 +1,7 @@
package com.moral.security.auth.login;
import com.fasterxml.jackson.databind.ObjectMapper;
+import com.moral.security.config.JwtSettings;
import com.moral.security.model.UserContext;
import com.moral.security.model.token.JwtToken;
import com.moral.security.model.token.JwtTokenFactory;
@@ -17,6 +18,7 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
+import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@@ -31,7 +33,8 @@
public class LoginAwareAuthenticationSuccessHandler implements AuthenticationSuccessHandler {
private final ObjectMapper mapper;
private final JwtTokenFactory tokenFactory;
-
+ @Autowired
+ private JwtSettings jwtSettings;
@Autowired
public LoginAwareAuthenticationSuccessHandler(final ObjectMapper mapper, final JwtTokenFactory tokenFactory) {
this.mapper = mapper;
@@ -49,7 +52,7 @@
Map<String, String> tokenMap = new HashMap<String, String>();
tokenMap.put("token", accessToken.getToken());
tokenMap.put("refreshToken", refreshToken.getToken());
-
+ tokenMap.put("expiredTime",jwtSettings.getTokenExpirationTime().toString());
response.setStatus(HttpStatus.OK.value());
response.setContentType(MediaType.APPLICATION_JSON_VALUE);
mapper.writeValue(response.getWriter(), tokenMap);
--
Gitblit v1.8.0