/// <summary> /// 获取用户权限操作按钮 /// </summary> /// <param name="context"></param> public void GetAuthorizeMenuButton(HttpContext context) { string pagePath = context.Request["moduleURL"]; int userID = Convert.ToInt32(context.Session["PKID"]); if (userID > 0 && pagePath != null) { try { string noRigthUrl = string.Format("/Page/CommonPage/NoRight.html"); BLL.Module moduleBiz = new BLL.Module(); int moduleID = moduleBiz.GetModuleByPath(pagePath).PKID; BLL.sysUser sysUserBiz = new BLL.sysUser(); if (sysUserBiz.GetUserModuleRigth(userID, moduleID)) { rigthList = sysUserBiz.GetUserModuleControl(userID, moduleID); string s = "{\"msg\":\"" + JsonConvert.SerializeObject(rigthList) + "\",\"success\":true}"; context.Response.Write(JsonConvert.SerializeObject(rigthList)); } else { context.Response.Write("{\"msg\":\"" + noRigthUrl + "\",\"success\":false}"); } } catch { throw; } } else { context.Response.Write("{\"msg\":\"" + context.Request.ApplicationPath + "Login.html\",\"success\":false}"); } }
/// <summary> /// 获取权限菜单 /// </summary> /// <param name="userId">用户登录ID</param> /// <returns></returns> public object GetMenuList(int userId) { List <MenuClass> menuJson = new BLL.Module().GetCTopMenu(userId); return(menuJson); }