Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public Task Execute(IJobExecutionContext context)
        {
            if (String.IsNullOrEmpty(Settings.SYS_SITE_MAP_PATH))
            {
                return(SafetyTask.CompletedTask);
            }

            if (Settings.SYS_SITE_MAP_PATH.IndexOf("localhost", StringComparison.Ordinal) != -1)
            {
                return(SafetyTask.CompletedTask);
            }

            return(SiteMapUtils.Generate());
        }
Exemplo n.º 2
0
        /// <summary>
        /// 生成站点地图
        /// </summary>
        /// <returns></returns>
        public string SiteMap_POST()
        {
            try
            {
                Settings.SYS_SITE_MAP_PATH = Utils.GetBaseUrl(HttpHosting.Context);
                Configuration.BeginWrite();
                Configuration.UpdateByPrefix("sys");
                Configuration.EndWrite();
                SiteMapUtils.Generate();
            }
            catch (Exception exc)
            {
                return(ReturnError(exc.Message));
            }

            return(ReturnSuccess(""));
        }