public JsonResult Copy(string widgetId) { _cookie.SetValue(Const.CopyWidgetCookie, widgetId, true, true); return(Json(new AjaxResult { Status = AjaxStatus.Normal, Message = "复制成功,请到需要的页面区域粘贴!" })); }
public JsonResult Copy(string widgetId) { _cookie.SetValue(Const.CopyWidgetCookie, widgetId, true, true); return(Json(new AjaxResult { Status = AjaxStatus.Normal, Message = _localize.Get("Copy success") })); }
public IActionResult PostMessage(MessageEntity entity, string redirect) { if (ModelState.IsValid) { _cookie.SetValue("Message", "true", 1); entity.Status = (int)RecordStatus.InActive; _messageService.Add(entity); } return(Redirect(redirect)); }
public void SetPreview(string id) { var theme = GetAllThemes().FirstOrDefault(m => m.ID.Equals(id, StringComparison.OrdinalIgnoreCase)); if (theme == null) { throw new Exception("Theme not found."); } _cookie.SetValue(PreViewCookieName, theme.ID, true, true); }
public ActionResult LogOn(LogOnCommand command) { Check.Argument.IsNotNull(command, "command"); Identifier id; if (string.IsNullOrWhiteSpace(command.UserName) || !Identifier.TryParse(command.UserName, out id)) { string errorMessage = string.IsNullOrWhiteSpace(command.UserName) ? TextMessages.OpenIDUserNameCannotBeBlank : TextMessages.InvalidOpenIDUserName; ModelState.AddModelError(ModelStateUserNameKey, errorMessage); } else { cookie.SetValue(CookieRememberMe, command.RememberMe ?? false); cookie.SetValue(CookieReturnUrl, !string.IsNullOrWhiteSpace(command.ReturnUrl) ? command.ReturnUrl : Url.Home()); try { Realm realm = new Realm(new Uri(Url.ToAbsolute(Url.LogOn()))); IAuthenticationRequest request = openId.CreateRequest(id, realm); ClaimsRequest fetch = new ClaimsRequest { Email = DemandLevel.Request }; request.AddExtension(fetch); request.RedirectToProvider(); } catch (ProtocolException e) { ModelState.AddModelError(ModelStateUserNameKey, e.Message); } } return(View()); }
public void SetPreview(string id) { _cookie.SetValue(PreViewCookieName, id, true, true); }
public void SaveCode(string code) { string protectedCode = dataProtector.Protect(code); _cookie.SetValue(CookieName, Base64StringEncode(protectedCode), true, true); }