IPAD 2卡住了怎么办 急==========
打开POCKET FROG 就停在最开始进去的界面 按HOME和关机都没用
最满意答案
基本思想是你的HandleUnauthorizedRequest方法需要为处理登录的页面/控制器提供“返回”参数。 而不是将您的用户发送到登录页面:
LogOnUrl = urlHelper.Action("LogIn", "Account")
您将提供额外的
returnUrl
查询参数:// for your ajax LogOnUrl = urlHelper.Action("LogIn", "Account", new { returnUrl = context.HttpContext.Request.RawUrl }) // for your non-ajax: context.Result = new RedirectToRouteResult( new System.Web.Routing.RouteValueDictionary { { "controller", "Account" }, { "action", "Login" }, { "returnUrl", context.HttpContext.Request.RawUrl } });
用户将登陆以下页面:
warheat1990.com/login?returnUrl=warheat1990.com%2Farticles%2Fbatman-arkham-knight-review
如果登录成功,那么您将解析查询param
returnUrl
值的请求(如果存在),并将用户重定向到该位置。The basic idea is that your HandleUnauthorizedRequest method needs to provide a "return to" parameter to the page/controller handling the login. Instead of sending your user to just the login page:
LogOnUrl = urlHelper.Action("LogIn", "Account")
You would provide an additional
returnUrl
query param:// for your ajax LogOnUrl = urlHelper.Action("LogIn", "Account", new { returnUrl = context.HttpContext.Request.RawUrl }) // for your non-ajax: context.Result = new RedirectToRouteResult( new System.Web.Routing.RouteValueDictionary { { "controller", "Account" }, { "action", "Login" }, { "returnUrl", context.HttpContext.Request.RawUrl } });
The user would land on a page like:
warheat1990.com/login?returnUrl=warheat1990.com%2Farticles%2Fbatman-arkham-knight-review
If login succeeds, then you would parse the request for the query param
returnUrl
value (if it exists), and redirect the user to that location.
相关问答
更多-
基本思想是你的HandleUnauthorizedRequest方法需要为处理登录的页面/控制器提供“返回”参数。 而不是将您的用户发送到登录页面: LogOnUrl = urlHelper.Action("LogIn", "Account") 您将提供额外的returnUrl查询参数: // for your ajax LogOnUrl = urlHelper.Action("LogIn", "Account", new { returnUrl = context.HttpContext.Request ...
-
确保在登录后返回上一页或反向链接网址的最佳做法(Best practices for securing return to previous page after login or back link url)[2022-03-04]
最常见的做法(也在电子商务网站上进行付款结算)是隐藏输入,并将URL重定向到: 对大多数人来说似乎足够安全...... The most common practice (also on e-commerce sites in payment checkout) is to have a hidden input with the UR ... -
登录后无法正常工作时重定向到上一个URL [关闭](Redirect to previous url after login is not working correctly [closed])[2022-04-29]
将当前网址分配给会话 $_SESSION['PrevUrl']=http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]; 使用它来重定向 If(isset($_SESSION['PrevUrl']) { header("Location: ".$_SESSION['PrevUrl']); }else{ //your fixed location } Assign your current url to session $_SESS ... -
不要使用完全限定的URL,请尝试使用相对URI。 而不是将URL指定为.... url: ""+location.hostname+" /member/actions/config-login2.php" 指定为, url: "member/actions/config-login2.php" 在AJAX调用中 如果它不起作用,JSONP是一个很好的替代品 请查看此帖子 Dont use fully qualified URLs, please t ...
-
JSF Ajax和Normal Redirect登录并返回到preveious页面(JSF AJAX and normal redirect to login and back to previous page)[2023-06-23]
我已经找到了解决方案,但我仍然认为它不是最佳解决方案。 非常感谢任何其他答案。 步骤1 配置应用程序以检测Ajax超时和正常超时。 这就是我做到的.. !! 第2步 发生会话超时时查找URI,使用此方法。 FacesAjaxAwareUserFilter将为您获取ServletRequest和ServletResponse 。 您可以使用此转换为HttpServletRequest和HttpServletResponse表单 HttpServletRequest request = (Htt ... -
因此,似乎您希望在ajax调用后保留页面状态的历史记录。 简单的答案是查看YUI历史记录管理器( http://developer.yahoo.com/yui/history/ )或jQuery历史插件( http://tkyk.github.com/jquery-history-plugin/ ) so it seems you want to keep a history of the state of a page after ajax calls. the easy answer is to che ...
-
您可以将redirect url返回给响应。 public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { // ... get target url String targetUrl = ""; try { ...
-
与此同时,我实施了一个非常适合我们的解决方案。 首先,我创建了一个AccessFilter,用于检查是否正在重定向到配置的登录URL。 public class AccessFilter extends OncePerRequestFilter { private static final Logger log = LoggerFactory.getLogger(AccessFilter.class); @Inject private SessionContext ctx; @In ...
-
Grails Ajax登录(Grails Ajax Login)[2023-04-09]
看起来你正确实现了它,也许有一些小错误,比如拼写错误。 BTW: 它在过滤器上实现,在实际控制器之前处理您的请求。 在您的情况下,它将是UsernamePasswordAuthenticationFilter (或RequestHolderAuthenticationFilter )。 控制器仅用于渲染其他数据。 至于ajax auth,它使用/login/ajaxSuccess ,它呈现JSON响应 默认情况下,它使用j_username和j_password 。 并且您可以使用ajax=true参数,而 ...