Commit c5ba36de authored by 杨锐's avatar 杨锐

策略工厂bug修复。

parent e3be4f1e
package cn.quantgroup.xyqb.controller.middleoffice.common.image; package cn.quantgroup.xyqb.controller.middleoffice.common.image;
import org.springframework.web.context.ContextLoader; import cn.quantgroup.xyqb.util.ApplicationContextHolder;
import org.springframework.web.context.WebApplicationContext;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -11,8 +10,7 @@ public class ImageVerifyStrategyFactory { ...@@ -11,8 +10,7 @@ public class ImageVerifyStrategyFactory {
static { static {
//cache //cache
WebApplicationContext context = ContextLoader.getCurrentWebApplicationContext(); Map<String, IImageVerifyStrategy> beansOfType = ApplicationContextHolder.getBeansOfType(IImageVerifyStrategy.class);
Map<String, IImageVerifyStrategy> beansOfType = context.getBeansOfType(IImageVerifyStrategy.class);
beansOfType.values().forEach(strategy -> strategiesMap.put(strategy.strategyName(), strategy)); beansOfType.values().forEach(strategy -> strategiesMap.put(strategy.strategyName(), strategy));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment