Song.Site/Teacher/Login.ashx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WeiSha.Common;
using Song.ServiceInterfaces;
using Song.Extend;

namespace Song.Site.Teacher
{
    /// <summary>
    /// login 的摘要说明
    /// </summary>
    public class Login : IHttpHandler
    {

        //账号(手机号),密码,验证码
        string acc = WeiSha.Common.Request.Form["tbAcc"].String;
        string pw = WeiSha.Common.Request.Form["tbPw"].String;
        string code = WeiSha.Common.Request.Form["tbCode"].String;
        //是否免登录,以及免登录的时效
        string isSign = WeiSha.Common.Request.Form["cbSign"].String;
        int signNum = WeiSha.Common.Request.Form["signnum"].Int32 ?? 0;
        protected HttpResponse Response { get; private set; }
        public void ProcessRequest(HttpContext context)
        {
            this.Response = context.Response;
            if (!string.IsNullOrWhiteSpace(acc))
            {
                isLogin();
            }
            else
            {
                if (context.Request.UrlReferrer != null)
                {
                    context.Response.Redirect(context.Request.UrlReferrer.ToString());
                }
                else
                {
                    context.Response.Redirect("index.ashx");
                }
            }
        }
        #region 验证登录
        private void isLogin()
        {
            //账号为空
            if (string.IsNullOrWhiteSpace(acc))
                this.Response.Redirect("index.ashx?error=1");
            //验证码不正确
            if (!isCodeImg())
                this.Response.Redirect("index.ashx?error=2&acc=" + acc);
            //当前机构,通过二级域名判断,如果不存在或无法判断,则返回默认机构
            Song.Entities.Organization org = Business.Do<IOrganization>().OrganCurrent();
            //通过验证,进入登录状态            
            Song.Entities.Teacher emp = Business.Do<ITeacher>().TeacherLogin(acc, pw, org.Org_ID);
            if (emp != null)
            {
                //如果没有设置免登录,则按系统设置的时效
                if (isSign == "")
后面还有 31 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读 AI

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。