Ver Fonte

自动实名开关

xiongzhu há 3 anos atrás
pai
commit
382c8ba99f

+ 2 - 0
src/main/java/com/izouma/nineth/service/IdentityAuthService.java

@@ -34,6 +34,7 @@ public class IdentityAuthService {
     private AdapayService                 adapayService;
     private RedisTemplate<String, Object> redisTemplate;
     private Environment                   env;
+    private SysConfigService              sysConfigService;
 
     public Page<IdentityAuth> all(PageQuery pageQuery) {
         return identityAuthRepo.findAll(JpaUtils.toSpecification(pageQuery, IdentityAuth.class), JpaUtils.toPageRequest(pageQuery));
@@ -110,6 +111,7 @@ public class IdentityAuthService {
     @Scheduled(fixedRate = 60000)
     @RedisLock(value = "autoValidate", expire = 30, unit = TimeUnit.MINUTES)
     public void autoValidate() {
+        if (!sysConfigService.getBoolean("auto_validate")) return;
         log.info("autoValidate");
         if (Arrays.asList(env.getActiveProfiles()).contains("dev")) {
             return;