Student/Base/AdminBasePage.cs

(开头部分) 2KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

using CC.Common;
namespace Student
{
    public class AdminBasePage : BasePage
    {
        public Model.Admin adminInfo = null;

        /// <summary>
        /// 载入判断
        /// </summary>
        /// <param name="e"></param>
        override protected void OnInit(EventArgs e)
        {
            adminInfo = GetAdminInfo();

            if (adminInfo == null)
            {
                Response.Redirect("/Login.aspx");
            }
        }
        /// <summary>
        /// 获取管理员信息
        /// </summary>
        /// <returns></returns>
        public Model.Admin GetAdminInfo()
        {
            Model.Admin model = null;
            HttpCookie cookie = Cookie.Get("admin");
            if (cookie == null)
            {
                StudentUtils.RemoveAllCookie();
                return null;
            }
            else 
            {
                string adminName = cookie.Values["name"];
                string adminPwd = cookie.Values["pwd"];
                if (adminName == "" || adminPwd == "")
                {
                    StudentUtils.RemoveAllCookie();
                    return null;
                }
                else
                {
                    model = AdminBLL.GetAdminInfoByAdminName(adminName);
                    if (model == null)
                    {
                        StudentUtils.RemoveAllCookie();
                        return null;
                    }
                    else
                    {
                        if (model.Password != adminPwd)
                        {
后面还有 13 行代码,购买后查看完整代码

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

AI 解读 AI

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

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