余烬+;web api单页重定向
我有一个带有ember和simplemembershipprovider的asp.net mvc web api应用程序。我正在使用的余烬模板和它,余烬应用程序是在用户成功登录到主控制器创建余烬+;web api单页重定向,api,redirect,model-view-controller,ember.js,routes,Api,Redirect,Model View Controller,Ember.js,Routes,我有一个带有ember和simplemembershipprovider的asp.net mvc web api应用程序。我正在使用的余烬模板和它,余烬应用程序是在用户成功登录到主控制器创建 public ActionResult Index(string returnUrl) { if (User.Identity.IsAuthenticated) { return View("App"); }
public ActionResult Index(string returnUrl)
{
if (User.Identity.IsAuthenticated)
{
return View("App");
}
ViewBag.ReturnUrl = returnUrl;
return View();
}
有时用户在访问站点时会单击带有id的电子邮件中的链接,如果url包含id,在成功登录后,我想根据url中提供的id将用户重定向到详细页面。例如。我很难弄明白怎么做。由于这是一个客户端ember路由,MVC不区分这条路由,因此它只忽略重定向请求。这是我试过的
returnUrl=“”
返回Json(新的{success=true,redirect=returnUrl})
重定向(returnUrl)
if(User.Identity.IsAuthenticated)
{
returnUrl=“”;
返回视图(“应用”);
}
ViewBag.ReturnUrl=返回URL
返回视图()李>
大多数浏览器甚至不将#发送到服务器,因此您不需要重定向它。这里有一些选择