ssm demo,用户角色权限管理
SSM框架整合
Spring
SpringMVC
MyBatis
导包:
1, spring
2, MyBatis
3, mybatis-spring
4, fastjson
5, aspectweaver----AspectJ框架
6, log4j-----打印日志信息
7, ojdbc6.jar
8, jstl.jar, standard.jar----标准标签库
9, commons-logging-1.2.jar
src下建立包结构
配置web.xml,spring-mvc.xml,spring-all.xml
建立表结构,使用PowerDesigner
前台页面,后台方法等。
项目结构:
代码(引用,未完全实现):
配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0"> <!-- 告诉web容器log4j的属性文件所在位置 -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:conf/log4j.properties</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener> <!-- spring框架提供的字符编码过滤器 -->
<filter>
<filter-name>characterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>characterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> <!-- 加载Spring的配置文件 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:conf/spring-config.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> <!-- 加载SpringMVC的配置文件 -->
<servlet>
<servlet-name>springDispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:conf/spring-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springDispatcherServlet</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0"> <!-- 告诉web容器log4j的属性文件所在位置 -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:conf/log4j.properties</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener> <!-- spring框架提供的字符编码过滤器 -->
<filter>
<filter-name>characterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>characterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> <!-- 加载Spring的配置文件 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:conf/spring-config.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> <!-- 加载SpringMVC的配置文件 -->
<servlet>
<servlet-name>springDispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:conf/spring-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springDispatcherServlet</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd"> <!-- 配置扫描器 -->
<context:component-scan base-package="com.hanqi.controller" /> <!-- 配置视图解析器 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<!-- <property name="prefix" value="/WEB-INF/"></property> -->
<property name="prefix" value="/"></property>
<property name="suffix" value=".jsp"></property>
</bean> <!-- 上传文件的解析器 -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- 上传文件的总大小, 单位是b -->
<property name="maxUploadSize" value="10240000"></property>
<!-- 单个文件的上传大小限制, 单位是b -->
<property name="maxUploadSizePerFile" value="1000000"></property>
<!-- 默认字符集 -->
<property name="defaultEncoding" value="utf-8"></property>
</bean> <!-- 开启SpringMVC注解驱动 -->
<mvc:annotation-driven>
<!-- 改成false, 原因是在spring中默认使用的json格式的转换器是Jackson.jar中的转换器, 但实际开发中更受欢迎的是fastjson.jar -->
<mvc:message-converters register-defaults="false">
<bean class="org.springframework.http.converter.StringHttpMessageConverter" />
<bean class="org.springframework.http.converter.xml.XmlAwareFormHttpMessageConverter" />
<bean class="org.springframework.http.converter.BufferedImageHttpMessageConverter" />
<bean class="org.springframework.http.converter.ByteArrayHttpMessageConverter"/>
<bean id="fastJsonHttpMessagerConverter" class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
<!-- 设置支持的媒体类型 -->
<property name="supportedMediaTypes">
<list>
<value>text/html; charset=utf-8</value>
<value>application/json; charset=utf-8</value>
</list>
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
</beans>
src下:
model层实体类:
package com.hanqi.model; public class SrUserRole {
private Integer id;
private Integer userid;
private Integer roleid; public SrUserRole() {
super();
} public SrUserRole(Integer id, Integer userid, Integer roleid) {
super();
this.id = id;
this.userid = userid;
this.roleid = roleid;
} public Integer getId() {
return id;
} public void setId(Integer id) {
this.id = id;
} public Integer getUserid() {
return userid;
} public void setUserid(Integer userid) {
this.userid = userid;
} public Integer getRoleid() {
return roleid;
} public void setRoleid(Integer roleid) {
this.roleid = roleid;
}
}
package com.hanqi.model; public class SrRoleMenu {
private Integer id;
private Integer roleid;
private Integer menuid; public SrRoleMenu(Integer id, Integer roleid, Integer menuid) {
super();
this.id = id;
this.roleid = roleid;
this.menuid = menuid;
} public SrRoleMenu() {
super();
} public Integer getId() {
return id;
} public void setId(Integer id) {
this.id = id;
} public Integer getRoleid() {
return roleid;
} public void setRoleid(Integer roleid) {
this.roleid = roleid;
} public Integer getMenuid() {
return menuid;
} public void setMenuid(Integer menuid) {
this.menuid = menuid;
}
}
package com.hanqi.model; public class SrRole {
private Integer id;
private String rolename;
private String status;
private boolean checked; public SrRole() {
super();
} public SrRole(Integer id, String rolename, String status) {
super();
this.id = id;
this.rolename = rolename;
this.status = status;
} public Integer getId() {
return id;
} public void setId(Integer id) {
this.id = id;
} public String getRolename() {
return rolename;
} public void setRolename(String rolename) {
this.rolename = rolename;
} public String getStatus() {
return status;
} public void setStatus(String status) {
this.status = status;
} public boolean getChecked() {
return checked;
} public void setChecked(boolean checked) {
this.checked = checked;
}
}
package com.hanqi.model; public class SrMenu {
private Integer id;
private String menuname;
private String url;
private String icon;
private String status;
private Integer parentid; public SrMenu() {
super();
} public SrMenu(Integer id, String menuname, String url, String icon, String status) {
super();
this.id = id;
this.menuname = menuname;
this.url = url;
this.icon = icon;
this.status = status;
} public Integer getId() {
return id;
} public void setId(Integer id) {
this.id = id;
} public String getMenuname() {
return menuname;
} public void setMenuname(String menuname) {
this.menuname = menuname;
} public String getUrl() {
return url;
} public void setUrl(String url) {
this.url = url;
} public String getIcon() {
return icon;
} public void setIcon(String icon) {
this.icon = icon;
} public String getStatus() {
return status;
} public void setStatus(String status) {
this.status = status;
} public Integer getParentid() {
return parentid;
} public void setParentid(Integer parentid) {
this.parentid = parentid;
}
}
dao层接口:
package com.hanqi.dao; import java.util.List; import com.hanqi.model.SrUser; public interface SrUserDao { SrUser login(SrUser srUser); int insertSrUser(SrUser srUser); List<SrUser> selectAll(); }
package com.hanqi.dao; import java.util.List; import com.hanqi.model.SrRole; public interface SrRoleDao { List<SrRole> selectAllRoles(String userid); List<SrRole> selectAll(); }
package com.hanqi.dao; import java.util.List; import com.hanqi.model.SrMenu;
import com.hanqi.model.SrUser; public interface SrMenuDao { List<SrMenu> selectMenus(SrUser currentUser); }
dao层实现方法:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hanqi.dao.SrUserDao"> <select id="login" parameterType="SrUser" resultType="SrUser">
select * from Sr_User s
<where>
s.username=#{username} and s.password=#{password}
</where>
</select> <select id="selectAll" resultType="SrUser">
select * from sr_user
</select> <insert id="insertSrUser" parameterType="SrUser">
insert into sr_user values
(testsq.nextval, #{username}, #{password}, #{realname}, #{status}, null)
</insert>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hanqi.dao.SrRoleDao"> <select id="selectAllRoles" resultType="SrRole">
SELECT * FROM sr_role sr WHERE sr.id IN
(SELECT sur.roleid FROM sr_user_role sur WHERE sur.userid=#{userid})
</select> <select id="selectAll" resultType="SrRole">
select * from sr_role
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hanqi.dao.SrMenuDao"> <select id="selectMenus" parameterType="SrUser" resultType="SrMenu">
SELECT * FROM SR_MENU SM
WHERE SM.ID IN (SELECT SRM.MENUID
FROM SR_ROLE_MENU SRM
WHERE SRM.ROLEID = (SELECT SUR.ROLEID
FROM SR_USER_ROLE SUR
WHERE SUR.USERID = #{id}))
</select> </mapper>
controller层控制器:
package com.hanqi.controller; import java.util.ArrayList;
import java.util.List; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.SessionAttributes; import com.alibaba.fastjson.JSONObject;
import com.hanqi.dao.SrUserDao;
import com.hanqi.model.SrUser; @Controller
@SessionAttributes("currentUser")
@RequestMapping("sruser")
public class SrUserController { @Autowired
private SrUserDao srUserDao; @RequestMapping("/login")
public String login(SrUser srUser, Model model) {
String vname = "login";
model.addAttribute("user", srUser);
SrUser su = srUserDao.login(srUser); if(su!=null) {
vname = "index";
model.addAttribute("currentUser", su);
} return vname;
} @RequestMapping("/register")
public String register(SrUser srUser) {
srUser.setStatus("1");
int a = srUserDao.insertSrUser(srUser); return "regsuccess";
} @ResponseBody
@RequestMapping("selectAll")
public JSONObject selectAll() {
JSONObject jo = new JSONObject();
List<SrUser> list = srUserDao.selectAll();
jo.put("total", list.size());
jo.put("rows", list); return jo;
} }
package com.hanqi.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import com.hanqi.dao.SrRoleDao;
import com.hanqi.model.SrRole; @Controller
@RequestMapping("/role")
public class SrRoleController { @Autowired
private SrRoleDao srRoleDao; @ResponseBody
@RequestMapping("/selectAllRoles")
public List<SrRole> selectAllRoles(String userid) { // 查询当前用户拥有的角色
List<SrRole> list = srRoleDao.selectAllRoles(userid);
// 查询所有的角色
List<SrRole> listAll = srRoleDao.selectAll(); for (int i = 0; i < list.size(); i++) {
for (int j = 0; j < listAll.size(); j++) {
if (listAll.get(j).getId() == list.get(i).getId()) {
listAll.get(j).setChecked(true);
}
}
}
return listAll;
}
}
package com.hanqi.controller; import java.util.ArrayList;
import java.util.List; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import com.hanqi.dao.SrMenuDao;
import com.hanqi.model.SrMenu;
import com.hanqi.model.SrUser; @Controller
@RequestMapping("/menu")
public class SrMenuController { @Autowired
private SrMenuDao srMenuDao; @ResponseBody
@RequestMapping("/selectMenus")
public List<SrMenu> selectMenus(HttpServletRequest request) { SrUser currentUser = (SrUser)request.getSession().getAttribute("currentUser"); List<SrMenu> list = new ArrayList<SrMenu>();
if(currentUser!=null) {
list = srMenuDao.selectMenus(currentUser);
} return list;
} }
前台jsp页面:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%
String basePath = request.getContextPath();
%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="<%=basePath %>/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="<%=basePath %>/jquery-easyui-1.5.1/jquery.easyui.min.js"></script>
<link type="text/css" rel="stylesheet" href="<%=basePath %>/jquery-easyui-1.5.1/themes/icon.css"></link>
<link type="text/css" rel="stylesheet" href="<%=basePath %>/jquery-easyui-1.5.1/themes/default/easyui.css"></link>
<script type="text/javascript" src="<%=basePath %>/jquery-easyui-1.5.1/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=basePath %>/js/index.js"></script>
<script type="text/javascript">
var __ctx = "<%=basePath %>";
</script>
<title>Insert title here</title>
</head>
<body class="easyui-layout">
<div data-options="region:'north',title:'North Title',split:true,height:100">
<h1>${currentUser.realname }</h1>
</div>
<div data-options="region:'west',title:'West',split:true,width:150">
<ul id="treemenu" class="easyui-tree"
data-options="url:'<%=basePath %>/menu/selectMenus.do',idField:'id',
parentField:'parentid',textField:'menuname'"></ul>
</div>
<div data-options="region:'center'">
<div id="tabs_userrole" class="easyui-tabs" data-options="fit:true">
</div>
</div>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%
String basePath = request.getContextPath();
%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript"
src="<%=basePath%>/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript"
src="<%=basePath%>/jquery-easyui-1.5.1/jquery.easyui.min.js"></script>
<link type="text/css" rel="stylesheet"
href="<%=basePath%>/jquery-easyui-1.5.1/themes/icon.css"></link>
<link type="text/css" rel="stylesheet"
href="<%=basePath%>/jquery-easyui-1.5.1/themes/default/easyui.css"></link>
<script type="text/javascript"
src="<%=basePath%>/jquery-easyui-1.5.1/locale/easyui-lang-zh_CN.js"></script>
<title>Insert title here</title>
</head>
<body>
<table id="userinfo" class="easyui-datagrid"
data-options="toolbar:'#tools',url:'<%=basePath%>/sruser/selectAll.do',fit:true,fitColumns:true,singleSelect:true">
<thead>
<tr>
<th data-options="field:'',width:100,checkbox:true"></th>
<th data-options="field:'id',width:100">id</th>
<th data-options="field:'username',width:100">用户名</th>
<th data-options="field:'realname',width:100">姓名</th>
<th data-options="field:'status',width:100">状态</th>
<th data-options="field:'mark',width:100">备注</th>
</tr>
</thead>
</table>
<div id="tools">
<a class="easyui-linkbutton" iconCls="icon-add"
onclick="showRoleInfos()">修改角色</a>
</div> <div id="dialog_roles" class="easyui-dialog"
data-options="closed:true,width:200,height:300,title:'更改角色',modal:true">
<ul id="role_tree"></ul>
</div> <script type="text/javascript">
function showRoleInfos() {
var data = $("#userinfo").datagrid("getSelected");
$("#role_tree").tree({
url:"role/selectAllRoles.do",
checkbox:true,
idField:"id",
parentField:"id",
textField:"rolename",
queryParams:{
userid:data.id
},
onCheck:function(node, checked) {
console.log(node);
console.log(checked);
}
});
$("#dialog_roles").dialog("open");
} //easyui实现自定义simpleData加载
$.fn.tree.defaults.loadFilter = function (data) {
var opt = $(this).data().tree.options;//整个tree的dom对象
var idField, textField, parentField;
if (opt.parentField) {
idField = opt.idField || 'id';
textField = opt.textField || 'text';
parentField = opt.parentField;
var i,l,
treeData = [],
tmpMap = [];
for (i = 0, l = data.length; i < l; i++) {
tmpMap[data[i][idField]] = data[i];
}
for (i = 0, l = data.length; i < l; i++) {
if (tmpMap[data[i][parentField]] && data[i][idField] != data[i][parentField]) {
if (!tmpMap[data[i][parentField]]['children'])
tmpMap[data[i][parentField]]['children'] = [];
data[i]['text'] = data[i][textField];
tmpMap[data[i][parentField]]['children'].push(data[i]);
} else {
data[i]['text'] = data[i][textField];
treeData.push(data[i]);
}
}
return treeData;
}
return data;
};
</script> </body>
</html>
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
<form action="sruser/login.do" method="post">
<table>
<tr>
<td>用户名: </td>
<td><input name="username" value="${user.username }" /></td>
</tr>
<tr>
<td>密码: </td>
<td><input name="password" value="${user.password }" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="登录" /></td>
</tr>
</table>
</form>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
<form action="sruser/register.do" method="post">
<table>
<tr>
<td>用户名: </td>
<td><input name="username" /></td>
</tr>
<tr>
<td>密码: </td>
<td><input name="password" /></td>
</tr>
<tr>
<td>确认密码: </td>
<td><input name="password1" /></td>
</tr>
<tr>
<td>姓名: </td>
<td><input name="realname" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="注册" /></td>
</tr>
</table>
</form>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%
String basePath = request.getContextPath();
%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
注册成功 !
<a href="<%=basePath %>/login.jsp">返回登录</a>
</body>
</html>
我写的不完全版……补全之后再贴上来
ssm demo,用户角色权限管理的更多相关文章
- Asp.Net MVC+BootStrap+EF6.0实现简单的用户角色权限管理
这是本人第一次写,写的不好的地方还忘包含.写这个的主要原因是想通过这个来学习下EF的CodeFirst模式,本来也想用AngularJs来玩玩的,但是自己只会普通的绑定,对指令这些不是很熟悉,所以就基 ...
- Asp.Net MVC+BootStrap+EF6.0实现简单的用户角色权限管理10
今天把用户的菜单显示和页面的按钮显示都做好了,下面先来个效果图 接下来说下我实现的方法: 首先我在每个方法前面都加了这个属性, /// <summary> /// 表示当前Action请求 ...
- [.Net MVC] 用户角色权限管理_使用CLK.AspNet.Identity
项目:后台管理平台 意义:一个完整的管理平台需要提供用户注册.登录等功能,以及认证和授权功能. 一.为何使用CLK.AspNet.Identity 首先简要说明所采取的权限控制方式.这里采用了基于角色 ...
- Asp.Net MVC+BootStrap+EF6.0实现简单的用户角色权限管理4
首先先加个区域,名为Admin using System.Web.Mvc; namespace AuthorDesign.Web.Areas.Admin { public class AdminAre ...
- Asp.Net MVC+BootStrap+EF6.0实现简单的用户角色权限管理9
前两天因有事就没来得及写.今天刚刚好空了.这次写的是对角色和管理员对页面按钮之间的控制.先看页面效果 说明:先根据角色设置好角色的权限,然后管理员在对应的角色下的权限去设置其权限. 在设置角色权限的时 ...
- JavaWeb之ssm框架整合,用户角色权限管理
SSM框架整合 Spring SpringMVC MyBatis 导包: 1, spring 2, MyBatis 3, mybatis-spring 4, fastjson 5, aspectwea ...
- Asp.Net MVC+BootStrap+EF6.0实现简单的用户角色权限管理6
接下来先做角色这一板块的(增删改查),首先要新建一个Role控制器,在添加一个RoleList的视图.表格打算采用的是bootstrap的表格. using System; using System. ...
- Asp.Net MVC+BootStrap+EF6.0实现简单的用户角色权限管理7
做完角色之后接下来做先做页面按钮的增加.删除.修改.这里用到的功能和角色那边是一样的.就不多说了.直接上代码. 后台控制器代码 using AuthorDesign.Web.App_Start.Com ...
- Asp.Net MVC+BootStrap+EF6.0实现简单的用户角色权限管理1
首先给上项目的整体框架图:,这里我没有使用BLL,因为感觉太烦了就没有去使用. 那么接下来我们首先先去Model层中添加Model. 管理员类: using System; using System. ...
随机推荐
- [LeetCode] 28. Implement strStr() ☆
Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle ...
- 哪些window你不知道的却实用的小技巧----window小技巧
前言 一直想要整理一篇有关于window比较全的使用小技巧,却又不知道从哪里开始写起.而让我准备动手写这边随笔的动力,还是在加入虫部落<一个绿色环保,充满朝气的好地方>,从大家的分享中,我 ...
- wget命令下载文件
wget -r -N -l -k http://192.168.99.81:8000/solrhome/ 命令格式: wget [参数列表] [目标软件.网页的网址] -V,–version 显示软 ...
- 【Android】完善Android学习(七:API 4.0.3)
备注:之前Android入门学习的书籍使用的是杨丰盛的<Android应用开发揭秘>,这本书是基于Android 2.2API的,目前Android已经到4.4了,更新了很多的API,也增 ...
- 谷歌地图 API 开发之添加标记(解析以及补充)
今天又看了下官网,发现官网上有地图标记的详细说明.当时居然眼瞎看不见,还琢磨了好久...#$%^&,一定是项目太急,没看到(^o^)/~地址:https://developers.google ...
- 2017.5.27 NOIP模拟赛(hzwer2014-5-16 NOIP模拟赛)
期望得分:100+100+60+30=290 实际得分:100+20+60+0=180 当务之急:提高一次正确率 Problem 1 双色球(ball.cpp/c/pas) [题目描述] 机房来了新一 ...
- Spark RDD——combineByKey
为什么单独讲解combineByKey? 因为combineByKey是Spark中一个比较核心的高级函数,其他一些高阶键值对函数底层都是用它实现的.诸如 groupByKey,reduceByKey ...
- HDU 1172 猜数字 (模拟)
题目链接 Problem Description 猜数字游戏是gameboy最喜欢的游戏之一.游戏的规则是这样的:计算机随机产生一个四位数,然后玩家猜这个四位数是什么.每猜一个数,计算机都会告诉玩家猜 ...
- perl6正则 6: 大小写/空白/匹配所有符合
这个 :g 只能写在外面 m:g /re/
- 数据库管理软件 Navicat Premium12 破解步骤
数据库管理软件 Navicat Premium12B https://pan.baidu.com/s/1QnAQwW-q0SQ1JglpFGxKOA 密码 : mwqc 里面的软件和补丁是 ...