Commit 343bdebbf930c2f43c961f171a481e4631cb164e

Authored by 王通
1 parent d3bbd39b

1.

src/main/java/com/bsth/controller/realcontrol/AdminUtilsController.java
... ... @@ -31,7 +31,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
31 31 import com.fasterxml.jackson.databind.SerializationFeature;
32 32 import org.slf4j.Logger;
33 33 import org.slf4j.LoggerFactory;
34   -import org.springframework.beans.factory.InitializingBean;
35 34 import org.springframework.beans.factory.annotation.Autowired;
36 35 import org.springframework.web.bind.annotation.RequestMapping;
37 36 import org.springframework.web.bind.annotation.RequestParam;
... ... @@ -49,7 +48,7 @@ import java.util.Set;
49 48 */
50 49 @RestController
51 50 @RequestMapping("adminUtils")
52   -public class AdminUtilsController implements InitializingBean {
  51 +public class AdminUtilsController {
53 52  
54 53  
55 54 Logger logger = LoggerFactory.getLogger(this.getClass());
... ... @@ -346,8 +345,7 @@ public class AdminUtilsController implements InitializingBean {
346 345 gatewayHttpLoader.afterPropertiesSet();
347 346 gatewayHttpUtils.afterPropertiesSet();
348 347 rfidHttpLoader.afterPropertiesSet();
349   - ssoConfig.setSystemCode(SystemParamCache.getSsoSystemCode());
350   - ssoConfig.setSsoAuthUrl(SystemParamCache.getUrlHttpSsoAuth());
  348 + ssoConfig.afterPropertiesSet();
351 349  
352 350 return "success";
353 351 } catch (Exception e) {
... ... @@ -366,8 +364,7 @@ public class AdminUtilsController implements InitializingBean {
366 364 gatewayHttpLoader.afterPropertiesSet();
367 365 gatewayHttpUtils.afterPropertiesSet();
368 366 rfidHttpLoader.afterPropertiesSet();
369   - ssoConfig.setSystemCode(SystemParamCache.getSsoSystemCode());
370   - ssoConfig.setSsoAuthUrl(SystemParamCache.getUrlHttpSsoAuth());
  367 + ssoConfig.afterPropertiesSet();
371 368  
372 369 return "success";
373 370 } catch (Exception e) {
... ... @@ -389,9 +386,4 @@ public class AdminUtilsController implements InitializingBean {
389 386  
390 387 return "error";
391 388 }
392   -
393   - @Override
394   - public void afterPropertiesSet() throws Exception {
395   - reloadAndApplySystemParam();
396   - }
397 389 }
398 390 \ No newline at end of file
... ...
src/main/java/com/bsth/security/SsoConfig.java
1 1 package com.bsth.security;
2 2  
3 3 import com.bsth.common.Constants;
  4 +import com.bsth.data.SystemParamCache;
  5 +import org.springframework.beans.factory.InitializingBean;
4 6 import org.springframework.beans.factory.annotation.Value;
5 7 import org.springframework.stereotype.Component;
6 8  
... ... @@ -9,7 +11,7 @@ import org.springframework.stereotype.Component;
9 11 * @author Hill
10 12 */
11 13 @Component
12   -public class SsoConfig {
  14 +public class SsoConfig implements InitializingBean {
13 15  
14 16 /**
15 17 * 是否开启sso登录
... ... @@ -87,4 +89,10 @@ public class SsoConfig {
87 89 public void setSsoAuthUrl(String ssoAuthUrl) {
88 90 this.ssoAuthUrl = ssoAuthUrl;
89 91 }
  92 +
  93 + @Override
  94 + public void afterPropertiesSet() throws Exception {
  95 + setSystemCode(SystemParamCache.getSsoSystemCode());
  96 + setSsoAuthUrl(SystemParamCache.getUrlHttpSsoAuth());
  97 + }
90 98 }
... ...