|
@@ -528,6 +528,36 @@ public class AuthorizeUtils {
|
|
|
return authByData(getToken(), systemId, uri);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 保存扩展值
|
|
|
+ *
|
|
|
+ * @param token
|
|
|
+ * @param expand
|
|
|
+ */
|
|
|
+ public static void setExpand(String token, String expand) {
|
|
|
+ RedisService<String> redisService = SpringBeanUtils.getBean(RedisService.class);
|
|
|
+ redisService.set("satoken:expand:" + token, expand, CommConsts.TOKEN_TIMEOUT);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取扩展值
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static String getExpand() {
|
|
|
+ RedisService<String> redisService = SpringBeanUtils.getBean(RedisService.class);
|
|
|
+ return redisService.get("satoken:expand:" + getToken());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 扩展值续签
|
|
|
+ */
|
|
|
+ public static void renewTimeoutExpand() {
|
|
|
+ String expand = getExpand();
|
|
|
+ RedisService<String> redisService = SpringBeanUtils.getBean(RedisService.class);
|
|
|
+ redisService.set("satoken:expand:" + getToken(), expand, CommConsts.TOKEN_TIMEOUT);
|
|
|
+ }
|
|
|
+
|
|
|
@Data
|
|
|
@Accessors(chain = true)
|
|
|
public static class CacheEntity implements Serializable {
|