vains-sofia / authorization-example Goto Github PK
View Code? Open in Web Editor NEWSpring OAuth2 Authorization Server集成与拓展项目,包括认证服务搭建、三方登录对接、自定义grant_type方式获取token、前后端分离实现,客户端、资源服务、前端单体项目对接认证服务实现等
License: Apache License 2.0
Spring OAuth2 Authorization Server集成与拓展项目,包括认证服务搭建、三方登录对接、自定义grant_type方式获取token、前后端分离实现,客户端、资源服务、前端单体项目对接认证服务实现等
License: Apache License 2.0
下面代码不对
public <T> T getHashAll(String key, Class<T> clazz) {
Map<String, Object> entries = hashOperations().entries(key);
if (ObjectUtils.isEmpty(entries)) {
return null;
}
return JsonUtils.objectCovertToObject(entries, clazz);
}
1.泛型根本没有用到
2.return JsonUtils.objectCovertToObject(entries, clazz
);
-> return JsonUtils.objectCovertToObject(entries,Map.class,String.class, clazz
)
setHashAll就已经这么用了
public void setHashAll(String key, Object value) {
Map<String, Object> map = JsonUtils.objectCovertToObject(value, Map.class, String.class, Object.class);
hashOperations().putAll(key, map);
}
下面的代码如果用户设置的timeout都是不到1分钟。那么 between 就变成0。实质上变成无期限了。
而且代码角度无期限的东西都是不太好的,如果最后的最大值还是0或者-1,
那么将timeout设置成30min(id token的默认值)或者60min(refresh token的默认值)。
// 计算时间差
Duration between = Duration.between(Instant.now(), maxInstant.get());
// 转为分钟
maxTimeout = between.toMinutes();
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.