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