This commit is contained in:
tanghc
2019-08-29 11:27:56 +08:00
parent 7e3c40ed92
commit 0ecc8cfb89
2 changed files with 6 additions and 1 deletions

View File

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

View File

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