/// <summary> /// 判断管理员是否已经登录(解决Session超时问题) /// </summary> public bool IsAdminLogin() { //如果Session为Null if (Session[HotoKeys.SESSION_ADMIN_INFO] != null) { return(true); } else { //检查Cookies string adminname = HotoUtils.GetCookie("AdminName", "DTcms"); //解密用户名 string adminpwd = HotoUtils.GetCookie("AdminPwd", "DTcms"); if (adminname != "" && adminpwd != "") { Hoto.BLL.manager bll = new Hoto.BLL.manager(); Hoto.Model.manager model = bll.GetModel(adminname, adminpwd); if (model != null) { Session[HotoKeys.SESSION_ADMIN_INFO] = model; return(true); } } } return(false); }
/// <summary> /// 判断管理员是否已经登录(解决Session超时问题) /// </summary> public bool IsAdminLogin() { //如果Session为Null if (Session[HotoKeys.SESSION_ADMIN_INFO] != null) { return true; } else { //检查Cookies string adminname = HotoUtils.GetCookie("AdminName", "DTcms"); //解密用户名 string adminpwd = HotoUtils.GetCookie("AdminPwd", "DTcms"); if (adminname != "" && adminpwd != "") { Hoto.BLL.manager bll = new Hoto.BLL.manager(); Hoto.Model.manager model = bll.GetModel(adminname, adminpwd); if (model != null) { Session[HotoKeys.SESSION_ADMIN_INFO] = model; return true; } } } return false; }