ERP.Web/Controllers/HomeController.cs

(开头部分) 2KB

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

using ERP.BLL.Base;
using ERP.Model.Base;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;

namespace ERP.Web.Controllers
{
    public class HomeController : BasicsController
    {
        
        public ActionResult login()
        {
            if (this.Get("act") == "login")
            {
                json.status = 1;
                try
                {
                    string pas = Md5Hash(Post("PAS").Trim());

                    T_BASE_ACCOUNT tba = new T_BASE_ACCOUNT();
                    tba.TBA_PASSWORD = pas;
                    if (!string.IsNullOrEmpty(Post("ACCOUNT")))
                    {
                        if (Post("ACCOUNT").Contains("@"))
                        {
                            tba.TBA_EMAIL = Post("ACCOUNT");
                        }
                        else
                        {
                            tba.TBA_IPHONE = decimal.Parse(Post("ACCOUNT"));
                        }
                    }
                    IList<T_BASE_ACCOUNT> list = BllT_BASE_ACCOUNT.GetIList("SelectT_BASE_ACCOUNT_LOGIN", tba);
                    if (list.Count > 0)
                    {
                        HttpCookie user = new HttpCookie("user");//定义Cookie  
                        user["TBA_DID"] = HttpUtility.UrlEncode(list[0].TBA_DID.ToString());
                        user["TBA_NAME"] = HttpUtility.UrlEncode(list[0].TBA_NAME);
                        user["TBA_IPHONE"] = HttpUtility.UrlEncode(list[0].TBA_IPHONE.ToString());
                        user["TBA_EMAIL"] = HttpUtility.UrlEncode(list[0].TBA_EMAIL);
                        user["TBA_HPHOTO"] = string.IsNullOrEmpty(list[0].TBA_HPHOTO)? "../res/assets/images/users/2.jpg" : HttpUtility.UrlEncode(list[0].TBA_HPHOTO);
                        user.Expires = DateTime.Now.AddDays(1);
                        Response.Cookies.Add(user);

                        if (bool.Parse(Post("REMEMBER")))
                        {
                            HttpCookie AccountName = new HttpCookie("AccountName");
                            AccountName.Value = Post("ACCOUNT");
                            Response.Cookies.Add(AccountName);
                        }
                        else
                        {
                            HttpCookie AccountName = new HttpCookie("AccountName");
                            AccountName.Expires = DateTime.Now.AddYears(-10);
                            System.Web.HttpContext.Current.Response.Cookies.Add(AccountName);

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

AI 解读

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

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