当前位置: 首页 > news >正文

网站攻击方式wordpress生成验证码发送代码

网站攻击方式,wordpress生成验证码发送代码,网站开发 男生,山西项目网用户关联角色操作 从前台发送请求 <a href"${pageContext.request.contextPath}/user/findUserByIdAndAllRole.do?id${user.id}" class"btn bg-olive btn-xs">添加角色</a>查询用户以及用户可以添加的角色 usercontroller //查询用户以及用…

用户关联角色操作

从前台发送请求

<a href="${pageContext.request.contextPath}/user/findUserByIdAndAllRole.do?id=${user.id}" class="btn bg-olive btn-xs">添加角色</a>

查询用户以及用户可以添加的角色

usercontroller

    //查询用户以及用户可以添加的角色@RequestMapping("/findUserByIdAndAllRole.do")public ModelAndView findUserByIdAndAllRole(@RequestParam(name = "id", required = true) String userid) throws Exception {ModelAndView mv = new ModelAndView();//1.根据用户id查询用户UserInfo userInfo = userService.findById(userid);//2.根据用户id查询可以添加的角色List<Role> otherRoles = userService.findOtherRoles(userid);mv.addObject("user", userInfo);mv.addObject("roleList", otherRoles);mv.setViewName("user-role-add");return mv;}

UserServiceImpl

  @Overridepublic UserInfo findById(String id) throws Exception {return userDao.findById(id);}@Overridepublic List<Role> findOtherRoles(String userid) throws Exception {return userDao.findOtherRoles(userid);}

IUserDao

    @Select("select * from users where id=#{id}")@Results({@Result(id = true, property = "id", column = "id"),@Result(property = "username", column = "username"),@Result(property = "email", column = "email"),@Result(property = "password", column = "password"),@Result(property = "phoneNum", column = "phoneNum"),@Result(property = "status", column = "status"),@Result(property = "roles",column = "id",javaType = java.util.List.class,many = @Many(select = "com.itheima.ssm.dao.IRoleDao.findRoleByUserId"))})UserInfo findById(String id) throws Exception;@Select("select * from role where id not in (select roleId from users_role where userId=#{userId})")List<Role> findOtherRoles(String userId) throws Exception;//@Param 有两个int参数mybaties不知道怎末匹配@Insert("insert into users_role(userId,roleId) values(#{userId},#{roleId})")

给用户添加角色

usercontroller

//给用户添加角色@RequestMapping("/addRoleToUser.do")public String addRoleToUser(@RequestParam(name = "userId", required = true) String userId, @RequestParam(name = "ids", required = true) String[] roleIds) throws Exception{userService.addRoleToUser(userId, roleIds);return "redirect:findAll.do";}

UserServiceImpl

    @Overridepublic void addRoleToUser(String userId, String[] roleIds) throws Exception {for(String roleId:roleIds){userDao.addRoleToUser(userId,roleId);}}

IUserDao

 //@Param 有两个int参数mybaties不知道怎末匹配@Insert("insert into users_role(userId,roleId) values(#{userId},#{roleId})")void addRoleToUser(@Param("userId") String userId,@Param("roleId") String roleId) throws Exception;
}

 

http://www.15wanjia.com/news/160460.html

相关文章:

  • 做a的视频在线观看网站怎么做的英文网站
  • 网站建设培训哪家好全球域名注册查询
  • 国家建设部网站平台建设银行网银盾官方网站下载
  • 西安网站优化排名推广怎么看网站的服务器
  • 企业网站制作需要多少费用洛阳 网站建设
  • 给网站做推广一般花多少钱网站建设服务定制
  • 珠海企业网站建设制作南阳网站建设seo
  • 排名网站优化培训甘肃建设职工教育培训中心网站
  • 球场 技术支持 东莞网站建设网站开发接外包
  • 制作公司网站的作用免费建站微信
  • 免费ppt成品网站做网站页面文件
  • 网站怎么做更新网站建设运营费用
  • 深圳市科技网站开发跨境电商是不是坑
  • 哪个网站上网好贵州做网站的公司有哪些
  • 最威海的网站建设本地58同城招聘网找工作
  • 网站如何做品牌营销我想做百度推广
  • 什么样的网站结构适合做seowordpress文章列表格子
  • 网站设计模板免费网络工程有限公司
  • 有什么好的免费网站做教育宣传app软件定制平台
  • 设计比例网站如何建设公司的网站
  • 做网站什么框架比较好西安旅游景点排名前十名
  • 网站建设方案报告wordpress 数据库下载
  • app介绍类网站模板美食网站制作代码
  • 仙桃网站网站建设wordpress PHP cpanel
  • 扬州网站建设网站快速关键词排名首页
  • 虚拟主机做网站沈阳制作网站企业
  • 电子商务网站 功能wordpress用户投稿单页
  • 免费网站建设报价百度电话号码查询
  • 北京企业建网站定制价格关于网站建设的文章
  • 杭州哪家公司做网站好dreamware做网站首页