pull/1/head
tanghc 5 years ago
parent 7e3c40ed92
commit 0ecc8cfb89
  1. 5
      sop-auth/src/main/java/com/gitee/sop/sopauth/auth/impl/OAuth2ManagerRedis.java
  2. 2
      sop-auth/src/main/java/com/gitee/sop/sopauth/controller/OAuth2Controller.java

@ -24,6 +24,8 @@ import java.util.concurrent.TimeUnit;
* 1注释掉OAuth2ManagerCache的@Service * 1注释掉OAuth2ManagerCache的@Service
* 2打开yml中redis部分 * 2打开yml中redis部分
* 3启用这个类的@Service * 3启用这个类的@Service
*
* @author tanghc
*/ */
//@Service //@Service
public class OAuth2ManagerRedis implements OAuth2Manager { public class OAuth2ManagerRedis implements OAuth2Manager {
@ -75,7 +77,8 @@ public class OAuth2ManagerRedis implements OAuth2Manager {
redisTemplate.opsForValue().set( redisTemplate.opsForValue().set(
getRefreshTokenKey(refreshToken), getRefreshTokenKey(refreshToken),
JSON.toJSONString(new RefreshToken(accessToken, authUser)), JSON.toJSONString(new RefreshToken(accessToken, authUser)),
reExpiresIn, // refreshToken过期时间 // refreshToken过期时间
reExpiresIn,
TimeUnit.SECONDS); TimeUnit.SECONDS);
} else { } else {
redisTemplate.opsForValue().set( redisTemplate.opsForValue().set(

@ -24,6 +24,8 @@ import java.net.URISyntaxException;
/** /**
* 授权认证 * 授权认证
*
* @author tanghc
*/ */
@Controller @Controller
@RequestMapping("oauth2") @RequestMapping("oauth2")

Loading…
Cancel
Save