Song.Site/Mobile/SelfPwFind.ashx.cs
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WeiSha.Common;
using Song.ServiceInterfaces;
using VTemplate.Engine;
namespace Song.Site.Mobile
{
/// <summary>
/// 找回密码
/// </summary>
public class SelfPwFind : BasePage
{
//账号,答案,密码
string acc = WeiSha.Common.Request.Form["tbAcc"].String;
protected string answer = WeiSha.Common.Request.Form["tbAnswer"].String;
string pw = WeiSha.Common.Request.Form["tbNewPw"].String;
//步骤
int step = WeiSha.Common.Request.QueryString["step"].Int16 ?? 1;
protected override void InitPageTemplate(HttpContext context)
{
if (Extend.LoginState.Student.IsLogin)
this.Response.Redirect("selfInfo.ashx");
this.Document.Variables.SetValue("step", step);
//第一步验证账号是否存在
if (step == 1)
{
if (string.IsNullOrWhiteSpace(acc)) return;
bool isExist = Business.Do<IStudent>().IsStudentExist(this.Organ.Org_ID, acc);
if (!isExist)
{
//账号不存在
this.Response.Redirect(addPara(context.Request.Url.PathAndQuery, "error=4", "step=1", "acc=" + acc));
}
else
{
this.Response.Redirect(addPara(context.Request.Url.PathAndQuery, "step=2", "acc=" + acc));
}
}
//第二步,验证安全问题是否正确
if (step == 2)
{
string acc = WeiSha.Common.Request.QueryString["acc"].String;
Song.Entities.Student st = Business.Do<IStudent>().StudentSingle(acc, this.Organ.Org_ID);
this.Document.Variables.SetValue("st", st);
if (string.IsNullOrWhiteSpace(answer)) return;
bool isExist = Business.Do<IStudent>().IsStudentExist(this.Organ.Org_ID, acc, answer);
if (!isExist)
{
//账号不存在
this.Response.Redirect(addPara(context.Request.Url.PathAndQuery, "error=6", "step=2", "acc=" + acc));
}
else
{
this.Response.Redirect(addPara(context.Request.Url.PathAndQuery, "step=3", "acc=" + acc));
}
}
//第三步,设置新密码
后面还有 44 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
