RMS.Manage.Web/Controllers/BaseController.cs

(开头部分) 6KB

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

using RMS.BLL;
using RMS.Common;
using RMS.EF.Model;
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Caching;
using System.Web.Mvc;
using System.Web.Security;

namespace RMS.Manage.Web.Controllers
{
    public class BaseController : Controller
    {
        public BaseController()
        {
            ViewBag.Title = GetRMSConfigByKey("RMSTitle");
        }

        NLogHelper nlog = new NLogHelper();
        /// <summary>
        /// 当前登录用户的Id
        /// </summary>
        protected static string UserId
        {
            get
            {
                return System.Web.HttpContext.Current.User.Identity.Name; 
            }
        }
        /// <summary>
        /// 当前是否登陆
        /// </summary>
        protected static bool IsLogin
        {
            get
            {
                return System.Web.HttpContext.Current.User.Identity.IsAuthenticated;
            }
        }
        /// <summary>
        /// 登陆的用户信息
        /// </summary>
        protected static RMS_User LoginUser
        {
            get
            {
                RMS_User result = new RMS_User();
                if (IsLogin && System.Web.HttpContext.Current.User.Identity is FormsIdentity)
                {
                    FormsIdentity iden = (System.Web.HttpContext.Current.User.Identity) as FormsIdentity;
                    if (iden != null)
                    {
                        FormsAuthenticationTicket ticket = iden.Ticket;
                        if (!string.IsNullOrWhiteSpace(ticket.UserData))
后面还有 149 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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