public static List <DTOSiteItem> GetSiteList() { var list = new List <DTOSiteItem>(); try { string args = GetNavArgs(); var sites = SiteMapCache.Instance().GetSites(); DTOSiteItem obj = null; foreach (var item in sites) { obj = new DTOSiteItem(); obj.SiteId = item.SiteId; obj.SiteName = item.SiteName; //obj.LoginUrl = string.Format(item.SiteLoginUrl, args); //obj.SiteState = item.AsSiteState.ToString(); list.Add(obj); } } catch (Exception ex) { LogHelper.Insert(ex, "GovApi:GetSiteList"); } return(list); }
protected void Page_Load(object sender, EventArgs e) { bool navFlag = string.IsNullOrEmpty(ConfigurationManager.AppSettings["AutoNav"]); var platSession = GovApi.GetPlatSession(); var zoneName = UAFactory.Instance.ZoneName; var zoneCache = FunctionAppCache.Instance.GetZone(zoneName); if (null == zoneCache) { redirectBack(platSession); return; } //if (string.IsNullOrEmpty(platSession.Uid) || null == zoneCache) //{ // redirectBack(platSession); // return; //} this.NavSiteId = GovApi.GetNavSiteId(); platSession.LastSiteId = this.NavSiteId; this.NavArgs = platSession.AuthArgs; this.NavApiUrl = GetNavApiUrl(platSession, navFlag); this.Cdn = zoneCache.Cdn; this.Version = zoneCache.ClientVersion; var req = HttpContext.Current.Request; string server = (req.QueryString[COLServerV2] ?? req.QueryString[COLServer]) ?? string.Empty; if (server == "-1") { return; } AllSitemapEntity site = null; if (!string.IsNullOrEmpty(server)) { site = SiteMapCache.Instance().GetPlatSiteConfig(server); } if (null != site) { redirect(site, platSession); return; } if (!string.IsNullOrEmpty(platSession.LastSiteId)) { site = SiteMapCache.Instance().GetSiteConfig(platSession.LastSiteId); } if (null != site) { redirect(site, platSession); return; } if (string.IsNullOrEmpty(server) && navFlag) { return; } site = SiteMapCache.Instance().GetSiteConfig(); redirect(site, platSession); }
public static string GetPlatAppId() { var cfg = SiteMapCache.Instance().GetSiteConfig(); if (null == cfg) { return(string.Empty); } return(cfg.SiteApiUrl); }
public static string GetBbsUrl() { var cfg = SiteMapCache.Instance().GetSiteConfig(); if (null == cfg) { return(string.Empty); } return(cfg.BbsUrl); }
void redirectBack(IPlatSessionData platSession) { LogHelper.Insert(string.Format("RedirectBack rawUrl:{0},data:{1}", Request.Url.PathAndQuery, platSession), LogType.Error); var plat = SiteMapCache.Instance().GetPlatConfig(); if (null != plat) { HttpContext.Current.Response.Redirect(plat.PlatMainUrl, false); } }
protected PlatSessionProvider() { var plat = SiteMapCache.Instance().GetPlatConfig(); if (null != plat) { _sessionMode = plat.SessionMode; _shareDomain = plat.ShareDomain; } }
public static string GetNavUrl() { var cfg = SiteMapCache.Instance().GetSiteConfig(); if (null == cfg) { return(string.Empty); } var session = GetPlatSession(); return(string.Format(cfg.NavUrl, session.AuthArgs).Replace('&', '|')); }