QiFeng.ZWY.MagWeb/Controllers/BaseController.cs
(开头部分) 16KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Mvc;
using log4net;
using QiFeng.LMSD.Utility;
using QiFeng.LMSD.Utility.Files;
using QiFeng.LMSD.Bll;
using QiFeng.LMSD.Model;
using QiFeng.LMSD.Model.Dto;
using ThoughtWorks.QRCode.Codec;
namespace QiFeng.LMSD.MagWeb.Controllers
{
public class BaseController : Controller
{
public readonly ILog Logger = LogManager.GetLogger(typeof(BaseController));
/// <summary>
/// 当前登录用户信息
/// </summary>
public ViewMcAccountDto CurrentUser;
public List<Modules> McModuleList;
public BaseController()
{
CurrentUser = System.Web.HttpContext.Current.Session["McAccounts"] as ViewMcAccountDto;
if (CurrentUser == null && System.Web.HttpContext.Current.Request.Cookies["McAccounts"] != null)
{
var username = System.Web.HttpContext.Current.Request.Cookies["McAccounts"].Values["u"];
var password = System.Web.HttpContext.Current.Request.Cookies["McAccounts"].Values["p"];
if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password))
{
username = EncryptionLibCbc.Decrypt(username, Encoding.UTF8);
var model = McAccountsBll.Instance.GetModelByLogin(username, password);
if (model != null)
{
System.Web.HttpContext.Current.Session["McAccounts"] = model;
CurrentUser = model;
ViewBag.CurrentUser = CurrentUser;
ViewBag.HtmlNavMenu = ReadAndInsertNavMenuHtml(CurrentUser);
}
else
{
var newcookie = new HttpCookie("McAccounts") { Expires = DateTime.Now.AddDays(-1) };
System.Web.HttpContext.Current.Response.Cookies.Add(newcookie);
}
}
else
{
var newcookie = new HttpCookie("McAccounts") { Expires = DateTime.Now.AddDays(-1) };
System.Web.HttpContext.Current.Response.Cookies.Add(newcookie);
}
}
后面还有 353 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。