62,041
社区成员
发帖
与我相关
我的任务
分享
//登录代码
[HttpPost]
public ActionResult Login(Member member)
{
Member loginMember = base.Context.Member.Where(a => a.Phone == member.Phone && a.Password == member.Password).FirstOrDefault();
if (loginMember != null)
{
System.Web.Security.FormsAuthentication.SetAuthCookie(loginMember.Phone, true, FormsAuthentication.FormsCookiePath);
return RedirectToAction("Home", "MyHome");
}
}
<system.web>
<authentication mode="Forms">
<forms domain="sdf" loginUrl="~/Mobile/Home/Login" timeout="2880" protection="All" path="/" ></forms>
</authentication>
<authorization>
<allow users="*"/>
</authorization>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>