From bbe672208fa862b3a01473336e5711b679279293 Mon Sep 17 00:00:00 2001 From: zlyx <1242874891@qq.com> Date: 星期三, 02 八月 2023 14:51:23 +0800 Subject: [PATCH] add 新增 SysSocialServiceImpl#updateByBo 更新社会化关系 ; update 优化 SysLoginService#socialRegister 对已绑定用户进行更新 ; reset 回滚上一提交中 SysSocialServiceImpl#selectByAuthId 会导致多种数据库不兼容 ; --- ruoyi-common/ruoyi-common-social/src/main/java/org/dromara/common/social/utils/AuthRedisStateCache.java | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ruoyi-common/ruoyi-common-social/src/main/java/org/dromara/common/social/utils/AuthRedisStateCache.java b/ruoyi-common/ruoyi-common-social/src/main/java/org/dromara/common/social/utils/AuthRedisStateCache.java index ae58348..0b6ec20 100644 --- a/ruoyi-common/ruoyi-common-social/src/main/java/org/dromara/common/social/utils/AuthRedisStateCache.java +++ b/ruoyi-common/ruoyi-common-social/src/main/java/org/dromara/common/social/utils/AuthRedisStateCache.java @@ -2,8 +2,8 @@ import lombok.AllArgsConstructor; import me.zhyd.oauth.cache.AuthStateCache; +import org.dromara.common.core.constant.GlobalConstants; import org.dromara.common.redis.utils.RedisUtils; -import org.dromara.common.social.config.properties.SocialProperties; import java.time.Duration; @@ -13,8 +13,6 @@ @AllArgsConstructor public class AuthRedisStateCache implements AuthStateCache { - private final SocialProperties socialProperties; - /** * 瀛樺叆缂撳瓨 * @@ -23,7 +21,8 @@ */ @Override public void cache(String key, String value) { - RedisUtils.setCacheObject(key, value, Duration.ofMillis(socialProperties.getTimeout())); + // 鎺堟潈瓒呮椂鏃堕棿 榛樿涓夊垎閽� + RedisUtils.setCacheObject(GlobalConstants.SOCIAL_AUTH_CODE_KEY + key, value, Duration.ofMinutes(3)); } /** @@ -35,7 +34,7 @@ */ @Override public void cache(String key, String value, long timeout) { - RedisUtils.setCacheObject(key, value, Duration.ofMillis(timeout)); + RedisUtils.setCacheObject(GlobalConstants.SOCIAL_AUTH_CODE_KEY + key, value, Duration.ofMillis(timeout)); } /** @@ -46,7 +45,7 @@ */ @Override public String get(String key) { - return RedisUtils.getCacheObject(key); + return RedisUtils.getCacheObject(GlobalConstants.SOCIAL_AUTH_CODE_KEY + key); } /** @@ -57,6 +56,6 @@ */ @Override public boolean containsKey(String key) { - return RedisUtils.hasKey(key); + return RedisUtils.hasKey(GlobalConstants.SOCIAL_AUTH_CODE_KEY + key); } } -- Gitblit v1.9.3