TrainSignManage/services/adminLogin.ashx.cs

(开头部分) 3KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Common;
using System.Web.Script.Serialization;

namespace witAdmin.services
{
    /// <summary>
    /// adminLogin 的摘要说明
    /// </summary>
    public class adminLogin : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            string userName = Units.GetStringQS("userName");
            string userPassword = Units.GetStringQS("userPassword"); ;
            string callback = Units.GetStringQS("callback");
            int status = 0;
            string token = "";
            Maticsoft.Model.H_adminUserMain model = new Maticsoft.Model.H_adminUserMain();
            Maticsoft.BLL.H_adminUserMain bll = new Maticsoft.BLL.H_adminUserMain();
            Maticsoft.Model.H_logForAdmin model1 = new Maticsoft.Model.H_logForAdmin();
            Maticsoft.BLL.H_logForAdmin bll1 = new Maticsoft.BLL.H_logForAdmin();
            if (bll.CheckUserAndPwd(userName, C_DESEncrypt.Encrypt(userPassword)))
            {

                model = bll.GetModelCheckUserInfo(userName);
                model1.adminUserID = model.adminUserID;
                model1.operationTime = DateTime.Now;
                model1.fromIP = HttpContext.Current.Request.UserHostAddress;
                model1.operationContent = userName;
                model1.operationType = "登陆";
                model1.fromeBrowser = HttpContext.Current.Request.Browser.Type;
                model1.isSuccess = "成功";
               // model1.errContent = "";
                bll1.Add(model1);

                token = C_UserToKen.UserToKen_Encrypt(model.adminUserID + "|" + userName + "|" + DateTime.Now + "|" + DateTime.Now.AddHours(2));

                HttpCookie cookie = new HttpCookie("witAdmin");//写入Cookie
                cookie.Values["token"] = token;
                cookie.Expires = DateTime.Now.AddHours(2);
                HttpContext.Current.Response.AppendCookie(cookie);


                status = 1;
            }
            else//账号密码错误
            {
                model = bll.GetModelCheckUserInfo(userName);
                if (model != null)//账号如果存在,记录失败日志
                {
                    model = bll.GetModelCheckUserInfo(userName);
                    model1.adminUserID = model.adminUserID;
                    model1.operationTime = DateTime.Now;
                    model1.fromIP = HttpContext.Current.Request.UserHostAddress;
                    model1.operationContent = userName;
后面还有 25 行代码,购买后查看完整代码

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

AI 解读 AI

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

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