|
@@ -7,6 +7,7 @@ import com.ozs.common.utils.uuid.IdUtils;
|
|
|
import io.jsonwebtoken.Claims;
|
|
|
import io.jsonwebtoken.Jwts;
|
|
|
import io.jsonwebtoken.SignatureAlgorithm;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -19,6 +20,7 @@ import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
|
@Component
|
|
|
+@Slf4j
|
|
|
public class AppTokenUtils {
|
|
|
|
|
|
@Autowired
|
|
@@ -51,6 +53,7 @@ public class AppTokenUtils {
|
|
|
public String getGeoHazardMonitorToken(HttpServletRequest request) {
|
|
|
// 获取请求携带的令牌
|
|
|
String token = getGeoToken(request);
|
|
|
+ log.info("request token:{}", token);
|
|
|
if (StringUtils.isNotEmpty(token)) {
|
|
|
try {
|
|
|
Claims claims = parseToken(token);
|
|
@@ -58,6 +61,7 @@ public class AppTokenUtils {
|
|
|
String uuid = (String) claims.get(Constants.APP_KEY);
|
|
|
String userKey = getGeoHazardMonitorTokenKey(uuid);
|
|
|
String tokens = redisCache.getCacheObject(userKey);
|
|
|
+ log.info("tokens:{}", tokens);
|
|
|
return tokens;
|
|
|
} catch (Exception e) {
|
|
|
}
|