Web/login.ashx.cs

(开头部分) 2KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Web.Class;
namespace Web
{
    /// <summary>
    /// login 的摘要说明
    /// </summary>
    public class login : IHttpHandler, System.Web.SessionState.IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            if (context.Request.Form["verifycode"].ToLower() != Class.Session.GetVerifyCode())
            {
                context.Response.Write("{\"status\":\"0\",\"msg\":\"验证码不正确\"}");
            }
            else
            {
                if (context.Request.Form["flag"] == "1")//管理员登录
                {
                    Model.tbHotel h = new Model.tbHotel();
                    h.H_Account = context.Request.Form["account"];
                    h.H_Pwd = Common.StrHelper.EncryptPassword(context.Request.Form["pwd"], "MD5");
                    if (new BLL.tbHotel().GetList(h).Count > 0)
                    {
                        Session.SetLoginType(Session.GLY);
                        Session.SetHAccount(h.H_Account);
                    }
                    else
                    {
                        context.Response.Write("{\"status\":\"0\",\"msg\":\"用户名或密码不正确\"}");
                        return;

                    }
                }
                else if (context.Request.Form["flag"] == "2")//员工登录
                {

                    Model.tbUser u = new Model.tbUser();
                    u.U_Account = context.Request.Form["account"];
                    u.U_Pwd = Common.StrHelper.EncryptPassword(context.Request.Form["pwd"], "MD5");

                    List<Model.tbUser> uList = new BLL.tbUser().GetList(u);

                    if (uList.Count > 0)
                    {
                        Session.SetRoleIdStr(new BLL.tbUserRole().GetRoleIdStr(u.U_Account));
                        Session.SetLoginType(Session.YG);
                        Session.SetUAccount(u.U_Account);
                        Session.SetHAccount(uList[0].H_Account);
                        Session.SetUAuthority(u.U_Account, Session.GetRoleIdStr());
                       
                    }
                    else
                    {
                        context.Response.Write("{\"status\":\"0\",\"msg\":\"用户名或密码不正确\"}");
后面还有 20 行代码,购买后查看完整代码

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

AI 解读 AI

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

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