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

网站建设优化网站PC关键词怎么做

网站建设优化,网站PC关键词怎么做,嘉兴网站建设方案,手机兼职赚钱平台Security是什么#xff1f; 是一个安全框架。可以用来做认证和授权 官网#xff1a;Spring Security SpringSecurity环境搭建 1、创建一个新的project 2、导入thymeleaf依赖 dependencygroupIdorg.thymeleaf/groupIdartifactIdthymeleaf…Security是什么 是一个安全框架。可以用来做认证和授权 官网Spring Security SpringSecurity环境搭建 1、创建一个新的project 2、导入thymeleaf依赖 dependencygroupIdorg.thymeleaf/groupIdartifactIdthymeleaf-spring5/artifactId/dependencydependencygroupIdorg.thymeleaf.extras/groupIdartifactIdthymeleaf-extras-java8time/artifactId/dependency3、导入静态资源Spring security教程案例素材狂神说Java之SpringBoot教程集合版: 狂神SpringBoot教程IDEA版中p34中用到的页面素材学习Spring security 4、在controller包下编写RouterController Controller public class RouterController {RequestMapping({/,/index,/index.html})public String index(){return index;}RequestMapping(/toLogin)public String toLogin(){return views/login;}RequestMapping(/level1/{id})public String level1(PathVariable(id) int id){return views/level1/id;}RequestMapping(/level2/{id})public String level2(PathVariable(id) int id){return views/level2/id;}RequestMapping(/level3/{id})public String level3(PathVariable(id) int id){return views/level3/id;} }5、显示结果 首页 登录页 用户认证和授权  1、导入security的starter dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-security/artifactId/dependency 2、在config包下编写一个类去继承WebSecurityConfigurerAdapter并且加上注解EnableWebSecurity EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter {//授权Overrideprotected void configure(HttpSecurity http) throws Exception {//请求授权的规则http.authorizeHttpRequests()//首页所有人都可以访问功能页只有对应权限的人才可以访问.antMatchers(/).permitAll().antMatchers(/level1/**).hasRole(vip1).antMatchers(/level2/**).hasRole(vip2).antMatchers(/level3/**).hasRole(vip3);//没有权限默认会到登录页面需要开启登录的页面http.formLogin();}//认证Overrideprotected void configure(AuthenticationManagerBuilder auth) throws Exception {//这些数据正常应该从数据库中读auth.inMemoryAuthentication().passwordEncoder(new BCryptPasswordEncoder()).withUser(qiu).password(new BCryptPasswordEncoder().encode(123456)).roles(vip1,vip2).and().withUser(root).password(new BCryptPasswordEncoder().encode(123456)).roles(vip1,vip2,vip3).and().withUser(guest).password(new BCryptPasswordEncoder().encode(123456)).roles(vip3);} }注销 //开启注销功能注销成功之后跳到首页http.logout().logoutSuccessUrl(/); 记住我 前端 input typecheckbox nameremember记住我 后端  //开启记住我功能自定义接受前端传过来的参数http.rememberMe().rememberMeParameter(remember); 原理是保存了一个cookie和一个session默认保存14天 定制登录页 http.formLogin().loginPage(/toLogin);
http://www.dnsts.com.cn/news/281011.html

相关文章:

  • 深圳 福田网站建设广州越秀区租房子多少钱一个月
  • 怎么在服务器上装WordPress深圳网站优化企业
  • 电子商务企业网站制作自己公司怎么做网站
  • 彩票网站模板源码做公司网站要钱吗
  • 网站搭建外贸加工中心编程培训学校
  • 北京专业网站制作服务标准wordpress 数字排序
  • 域名管理网站廊坊哪家公司做网站
  • 在网站文字上做超链接备案网站建设方案书模板
  • 广州seo网站推广平台十大黑心装修公司
  • 深圳市罗湖网站建设眉山手机网站建设
  • 新网站怎么做网络推广营销型网站是什么
  • 为何打不开中国建设银行网站wordpress 管理员密码忘记
  • 网站上传都传些什么文件东莞头条最近15天新闻
  • 内蒙古建设厅门户网站移动端网站
  • 坪山网站建设设计淘宝客自己做网站
  • 做网站空间不给账号密码php网站开发优势
  • html网站尺寸重庆网站建设公司模板
  • 网站建设方法有那几种平台搭建一条龙
  • 北京大兴做环保备案网站做一个同城app得多少钱
  • 给别人做的网站涉及到违法搜网站网
  • 重庆 机械有限公司 沙坪坝网站建设四川建设安全监督管理局网站
  • 湖南省长沙建设厅网站优质做网站公司
  • 淄博专业网站建设价格核心关键词举例
  • 百度网站建设费用网站的维护步骤
  • 中国铁建华南建设有限公司网站做网站需要哪些人员
  • 北京学设计去哪个网站个人如果做网站赚钱
  • 中科建建设发展有限公司网站百度推广管家登录
  • 用 asp net 做 的网站wordpress 内容 权限
  • 宁波做公司网站的公司做app开发公司
  • 加强酒店网站建设的建议网页设计地址