Commit c0d0c679 by zhouhaibao

[+]时间范围取配置时间

1 parent 5d6e8c05
......@@ -71,11 +71,12 @@ public class AuthController {
if (gatewayService == null) {
throw ResultException.create("请求参数校验不通过");
}
Long jwtTtl = gatewayService.getJwtTtl();
//验证时间戳
long diff = System.currentTimeMillis() - request.getTimestamp().getTime();
//if (diff < 0 || diff > 5 * 60 * 1000L) {
//throw ResultException.create("请求参数timestamp不在系统允许的范围内");
//}
if (diff < 0 || diff > jwtTtl) {
throw ResultException.create("请求参数timestamp不在系统允许的范围内");
}
//验证secret
if ("SM3".equals(request.getGrantType())) {
if (!SM3Utils.verify(gatewayService.getSecret(), request.getAppSecret(), gatewayService.getAppKey())) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!