NBIbatis.WX/Common/UserLoginModule.cs

(开头部分) 2KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using NBIbatis.Model;
using NBIbatis.Rules;
using NBIbatis.Utility;

namespace NBIbatis.WX
{
    class UserLoginModule : System.Web.IHttpModule
    {
        public void Dispose()
        {
        }
        public void Init(HttpApplication context)
        {
            context.PreRequestHandlerExecute += new EventHandler(context_PreRequestHandlerExecute);
        }

        void context_PreRequestHandlerExecute(object sender, EventArgs e)
        {
            HttpRequest request = ((HttpApplication)sender).Context.Request;
            if (request.CurrentExecutionFilePathExtension == ".aspx")
            {
                string path = request.Url.ToString();
                int n = path.ToLower().IndexOf("login.aspx");
                if (n > 0 || path.ToLower().IndexOf("index.html") > 0)
                    return;

                if (path.ToLower().IndexOf("about.aspx") > 0)
                {
                    SessionHelper.ClearSession("user");
                }

                //还没登录
                if (SessionHelper.GetSession("user") == null)
                {
                    LoginUser user;
                    if (request["UserSq"] != null)
                    {
                        LoginUserRule LoginUserRule = new LoginUserRule();
                        user = LoginUserRule.GetByID(Guid.Parse(request["UserSq"]));
                        SessionHelper.SetSession("user",user);
                    }
                    else
                    {
                        //((HttpApplication)sender).Context.Response.Write("<script>ShowIframe('登陆过期,请重新登陆','LoginMode.aspx',650,450);</script>");
                        //((HttpApplication)sender).Context.Response.Write("登陆过期,请重新登陆");
                        //((HttpApplication)sender).Context.Response.End();

                        //TODO: 上线
                        user = new LoginUser();
                        user.UserSq = new Guid("306A7366-2FC2-4E91-ADFC-AB27B974DE38");
                        user.UserID = "wwd";
                        user.UserCName = "吴文达";
                        user.DepartmentName = "网络信息部";
                        user.DepartmentSq = new Guid("00000000-0000-0000-0000-000000000045");
                        user.TelMain = "0592-2324233 12283739109";
后面还有 11 行代码,购买后查看完整代码

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

AI 解读

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

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