示例#1
0
 void Init(CloudConfig config)
 {
     this.CurrentApp = config.App;
     appService      = new XService(config.Authcenter);                                          //app授权中心
     appService.RefreshHttp(new XHttpClient(config.Authcenter.AppID, config.Authcenter.Origin)); //创建连接
     if (config.Dependencies != null)
     {
         TokenProvider tokenProvider = new TokenProvider(appService); //Token刷新器
         foreach (ServiceInfo serviceInfo in config.Dependencies)
         {
             XService xService = new XService(serviceInfo)
             {
                 TokenProvider = tokenProvider
             };
             DicServices[serviceInfo.AppID] = xService;
         }
     }
 }
示例#2
0
 public TokenProvider(XService AuthService)
 {
     this.AppAuthService = AuthService;
     dicTokens           = new Dictionary <string, Token>();
 }