智慧保安后台管理-外网项目备份
zhongrj
2024-11-12 cdfffee538d44b6cfe1993d188e9b520619e7a86
增加登录到期验证
1 files modified
28 ■■■■■ changed files
src/main/java/org/springblade/modules/auth/endpoint/BladeTokenEndPoint.java 28 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/auth/endpoint/BladeTokenEndPoint.java
@@ -118,15 +118,15 @@
        ITokenGranter granter = TokenGranterBuilder.getGranter(grantType);
        UserInfo userInfo = granter.grant(tokenParameter);
//        try {
//            Long parse = new SimpleDateFormat("yyyy-MM-dd").parse("2024-04-30").getTime();
//            long now= System.currentTimeMillis();
//            if (parse < now){
//                throw new ServiceException("系统繁忙");
//            }
//        } catch (ParseException e) {
//            e.printStackTrace();
//        }
        try {
            Long parse = new SimpleDateFormat("yyyy-MM-dd").parse("2024-12-30").getTime();
            long now= System.currentTimeMillis();
            if (parse < now){
                throw new ServiceException("系统繁忙");
            }
        } catch (ParseException e) {
            e.printStackTrace();
        }
        //校验
@@ -216,6 +216,16 @@
        ITokenGranter granter = TokenGranterBuilder.getGranter(grantType);
        try {
            Long parse = new SimpleDateFormat("yyyy-MM-dd").parse("2024-12-30").getTime();
            long now= System.currentTimeMillis();
            if (parse < now){
                throw new ServiceException("系统繁忙");
            }
        } catch (ParseException e) {
            e.printStackTrace();
        }
        UserInfo userInfo = granter.grant(tokenParameter);