我想写一个setup,里面初始化wxApi,但是好像在setup里ioc容器还没初始化,PropertiesProxy 给了我刚null
@IocBean
public class Wx_AccessSetup implements Setup{
public static Ioc ioc;
@Inject
private PropertiesProxy conf;
public void init(NutConfig nc) {
Wx_AccessSetup.ioc = nc.getIoc();
WxApi2Impl wxApi = new WxApi2Impl();
wxApi.configure(conf, "weixin."); // 从配置信息里面读取各种需要的参数
((Ioc2)nc.getIoc()).getIocContext().save("app", "wxApi", new ObjectProxy(wxApi)); //将对象放入ioc容器
//WxHandler.getAccessToken();
}
public void destroy(NutConfig nc) {
}
}