protected void Page_Load(object sender, EventArgs e) { websiteInfo = DataLoadTool.GetWebsiteInfoModel(); if (string.IsNullOrEmpty(websiteInfo.MallType)) { websiteInfo.MallType = "0"; } model = bll.GetProduct(Request["pid"]); shareLink = Request.Url.AbsoluteUri; if (bll.GetWebsiteInfoModel().IsDistributionMall.Equals(1)) { if (bll.IsLogin) { UserInfo CurrentUserInfo = bll.GetCurrentUserInfo(); if (bll.IsWeiXinBrowser && (string.IsNullOrEmpty(CurrentUserInfo.WXNickname) || string.IsNullOrEmpty(CurrentUserInfo.WXHeadimgurl))) { Session.Clear(); Response.Redirect(Request.Url.AbsoluteUri); } if (string.IsNullOrEmpty(Request["sid"])) { shareLink = string.Format("http://{0}{1}?action=show&pid={2}&sid={3}", Request.Url.Host, Request.FilePath, Request["pid"], CurrentUserInfo.AutoID); } else { ShareUserInfo = bllUser.GetUserInfoByAutoID(int.Parse(Request["sid"])); } } else { Response.Write("请用微信打开"); Response.End(); } } }
public void ProcessRequest(HttpContext context) { string phone = context.Request["phone"]; string vcode = context.Request["vcode"]; string websiteOwner = bllUser.WebsiteOwner; var lastSmsVerCode = bllSms.GetLastSmsVerificationCode(phone); if (lastSmsVerCode == null) { apiResp.code = (int)APIErrCode.CheckCodeErr; apiResp.msg = "请先获取手机验证码"; bllUser.ContextResponse(context, apiResp); return; } if (lastSmsVerCode.VerificationCode != vcode) { apiResp.code = (int)APIErrCode.CheckCodeErr; apiResp.msg = "手机验证码错误"; bllUser.ContextResponse(context, apiResp); return; } if ((DateTime.Now - lastSmsVerCode.InsertDate).TotalMinutes >= 5) { apiResp.code = (int)APIErrCode.CheckCodeErr; apiResp.msg = "手机验证码已过期,请重新获取"; bllUser.ContextResponse(context, apiResp); return; } BLLJIMP.Model.UserInfo ouser = bllUser.GetUserInfoByPhone(phone, websiteOwner); ouser.Password = ZentCloud.Common.Rand.Number(6); bool smsBool = false; string smsMsg = ""; BLLJIMP.Model.WebsiteInfo website = bllUser.GetWebsiteInfoModelFromDataBase(websiteOwner); bllSms.SendSmsMisson(ouser.Phone, "您的密码是:" + ouser.Password, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), website.SmsSignature, out smsBool, out smsMsg); if (!smsBool) { apiResp.code = (int)APIErrCode.OperateFail; apiResp.msg = "发送短信密码失败"; bllUser.ContextResponse(context, apiResp); return; } if (bllUser.Update(ouser, string.Format("Password='******'", ouser.Password), string.Format("AutoID={0}", ouser.AutoID)) <= 0) { apiResp.code = (int)APIErrCode.OperateFail; apiResp.msg = "重置失败"; bllUser.ContextResponse(context, apiResp); return; } apiResp.status = true; apiResp.code = (int)APIErrCode.IsSuccess; apiResp.msg = "重置完成,新密码将发送到您的手机"; bllUser.ContextResponse(context, apiResp); }
protected void Page_Load(object sender, EventArgs e) { currUserInfo = DataLoadTool.GetCurrUserModel(); currWebSiteModel = DataLoadTool.GetWebsiteInfoModel(); currWebSiteOwnerModel = new BLLJIMP.BLLUser("").GetUserInfo(currWebSiteModel.WebsiteOwner); signUpLoginName = Common.Base64Change.EncodeBase64ByUTF8(currWebSiteOwnerModel.UserID); signUploginPwd = Common.DEncrypt.ZCEncrypt(currWebSiteOwnerModel.Password); GetPageActionType(); }
protected void Page_Load(object sender, EventArgs e) { if (bllMall.IsLogin) { userInfo = DataLoadTool.GetCurrUserModel(); } else { Response.Redirect(string.Format("/App/Cation/Wap/Login.aspx?redirecturl={0}", Request.FilePath)); } currWebSiteInfo = bllMall.GetWebsiteInfoModel(); if (currWebSiteInfo.MallTemplateId.Equals(1))//外卖 { WXMallIndexUrl = "Indexv2.aspx"; } websiteInfo = DataLoadTool.GetWebsiteInfoModel(); if (string.IsNullOrEmpty(websiteInfo.MallType)) { websiteInfo.MallType = "0"; } }
protected void Page_Load(object sender, EventArgs e) { websiteOwner = BLLJIMP.BLLStatic.bll.WebsiteOwner; webSite = bllWebsite.GetWebsiteInfoModelFromDataBase(); }
void context_AcquireRequestState(object sender, EventArgs e) { // 获取应用程序 HttpApplication application = (HttpApplication)sender; CurrentPath = application.Request.FilePath == null ? "" : application.Request.FilePath.ToLower(); #region 判断文件是否检查 string pageExtraName = System.IO.Path.GetExtension(CurrentPath); List <string> pageExtraNameFilterList = new List <string>() { ".aspx", ".ashx", ".cn", ".com", ".net" }; //只处理aspx、ashx页面 if (!pageExtraNameFilterList.Contains(pageExtraName)) { ToLog("后缀不检查:" + CurrentPath); return; } //前端页面排除掉 if (CurrentPath.IndexOf("/wap/") > -1 || CurrentPath.IndexOf("/m/") > -1 || CurrentPath.IndexOf("/customize/") > -1 || CurrentPath.IndexOf("/wxcallback.aspx") > -1 || CurrentPath.IndexOf("/ueditorcontroller.ashx") > -1) { ToLog("前端页面排除掉:" + CurrentPath); return; } #endregion #region 过滤页排除 //不过滤列表 List <string> noFilterList = new List <string>() { //"/serv/api/admin/" }; //不过滤列表中特殊的链接 List <string> filterList = new List <string>() { //"/serv/api/admin/user/islogin.ashx", //"/serv/api/admin/mall/statistics/chart.ashx", //"/serv/api/admin/mall/statistics/list.ashx", //"/serv/api/admin/dashboard/get.ashx", //"/serv/api/admin/log/selectactionlist.ashx", //"/serv/api/admin/log/list.ashx", //"/serv/api/admin/account/selectlist.ashx" }; //获取过滤页面表数据 if (!noFilterList.Exists(p => CurrentPath.StartsWith(p)) || filterList.Exists(p => CurrentPath.StartsWith(p))) { //List<BLLPermission.Model.ModuleFilterInfo> pathList = bllPer.GetList<BLLPermission.Model.ModuleFilterInfo>(string.Format("FilterType !='WXOAuth'")); List <BLLPermission.Model.ModuleFilterInfo> pathList = bllRedis.GetModuleFilterInfoList().Where(p => p.FilterType != "WXOAuth").ToList(); if (pathList.Where(p => (CurrentPath.Equals(p.PagePath, StringComparison.OrdinalIgnoreCase) && p.MatchType.Equals("all")) || (CurrentPath.StartsWith(p.PagePath, StringComparison.OrdinalIgnoreCase) && p.MatchType.Equals("start")) || (CurrentPath.EndsWith(p.PagePath, StringComparison.OrdinalIgnoreCase) && p.MatchType.Equals("end")) || (CurrentPath.ToLower().Contains(p.PagePath.ToLower()) && p.MatchType.Equals("contains")) ).Count() > 0) { ToLog("过滤页面:" + CurrentPath); return;//匹配 } } #endregion #region 检查是否登录 //检查是否登录 if (application.Session == null || application.Session[Common.SessionKey.LoginStatu] == null || application.Session[Common.SessionKey.UserID] == null) { this.GotoLoginPage(application, pageExtraName); return; } if (!application.Session[Common.SessionKey.LoginStatu].ToString().Equals("1")) { //未登录 this.GotoLoginPage(application, pageExtraName); return; } userID = application.Session[Common.SessionKey.UserID].ToString();//获取登录ID CurrentUserInfo = bllUser.GetUserInfo(userID, bllUser.WebsiteOwner); //判断用户是否已被禁用 if (CurrentUserInfo.IsDisable == 1) { GotoIsDisable(application, pageExtraName); return; } if (CurrentUserInfo.UserType == 1) { ToLog("超级管理员排除:" + CurrentPath); return; } #endregion #region 站点验证,判断用户是否属于当前站点,系统超级管理员除外 if (HttpContext.Current.Session["WebsiteInfoModel"] != null && this.CurrentUserInfo.UserType != 1) { BLLJIMP.Model.WebsiteInfo webSiteModel = (BLLJIMP.Model.WebsiteInfo)HttpContext.Current.Session["WebsiteInfoModel"]; if (webSiteModel.WebsiteExpirationDate.HasValue && webSiteModel.WebsiteExpirationDate.Value.AddDays(1).AddSeconds(-1) < DateTime.Now) { this.GotoIsExpirePage(application, pageExtraName); return; } if (this.CurrentUserInfo.WebsiteOwner == null) { this.CurrentUserInfo.WebsiteOwner = ""; } if (!webSiteModel.WebsiteOwner.Equals(this.CurrentUserInfo.WebsiteOwner, StringComparison.OrdinalIgnoreCase)) { //ToLog(string.Format("不属于当前用户,网站所有者{0}当前用户{1}路径:{2}", webSiteModel.WebsiteOwner,userModel.WebsiteOwner,currAbsolutePath)); this.GotoNoPmsPage(application, pageExtraName); return; } } #endregion #region 页面权限验证 if (string.IsNullOrWhiteSpace(userID)) { this.GotoNoPmsPage(application, pageExtraName); return; } BLLPermission.BLLMenuPermission bllMenuPer = new BLLPermission.BLLMenuPermission(userID); //if (bllPms.IsActionPermissionV2(bllMenuPer.WebsiteOwner)) //{ string nAction = GetAction(application); //参数名不分大小写 //检查用户是否有该页面权限V2 if (CurrentUserInfo.PermissionGroupID.HasValue) { ZentCloud.BLLPermission.Model.PermissionGroupInfo perGroupInfo = bllPms.Get <ZentCloud.BLLPermission.Model.PermissionGroupInfo>(string.Format(" GroupID={0}", CurrentUserInfo.PermissionGroupID)); if (perGroupInfo != null && perGroupInfo.GroupType == 3) //管理员权限跟站点所有者一致 { userID = bllMenuPer.WebsiteOwner; } } if (!bllMenuPer.NewCheckUserAndPath(userID, bllMenuPer.WebsiteOwner, CurrentPath, nAction)) { this.GotoNoPmsPage(application, pageExtraName); return; } ToLog("权限检查通过: userID:" + userID + ",WebsiteOwner:" + bllMenuPer.WebsiteOwner + "," + CurrentPath); //} //else //{ // //检查用户是否有该页面权限 // if (!bllMenuPer.CheckUserAndPath(userID, CurrentPath)) // { // this.GotoNoPmsPage(application, pageExtraName); // return; // } //} #endregion }