using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using COMCMS.Common; using COMCMS.Core; using XCode; namespace COMCMS.Web.Common { /// /// 网站前台基础页 /// public class HomeBaseController : Controller { public Config cfg; public JsonTip tip = new JsonTip(); public HomeBaseController() { cfg = Config.GetSystemConfig(); } /// /// Alert提示并返回 /// /// 提示内容 public IActionResult AlertAndGoBack(string str) { if (!string.IsNullOrWhiteSpace(str)) str = str.Replace("'", "\\'"); return Content($""); } /// /// Alert提示并跳转到指定URL /// /// 提示内容 /// 跳转地址 public IActionResult AlertAndRedirect(string str, string url) { if (!string.IsNullOrWhiteSpace(str)) str = str.Replace("'", "\\'"); return Content($""); } #region MyRegion /// /// 显示提示页面 /// /// 提示语 /// 成功/失败 /// 返回URL /// public IActionResult EchoTip(string Message, bool IsSuccess = false, string ReturnURL = "") { ViewBag.IsSuccess = IsSuccess; ViewBag.Message = Message; ViewBag.ReturnURL = ReturnURL; ViewBag.cfg = cfg; return View("EchoTip"); } #endregion } }