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

微信公众号私自建设电影网站网站前台开发教程

微信公众号私自建设电影网站,网站前台开发教程,wordpress页尾添加信息,做网站策划书#x1f341; 作者#xff1a;知识浅谈#xff0c;CSDN签约讲师#xff0c;CSDN博客专家#xff0c;华为云云享专家#xff0c;阿里云专家博主 #x1f4cc; 擅长领域#xff1a;全栈工程师、爬虫、ACM算法 #x1f492; 公众号#xff1a;知识浅谈 #x1f525;网站… 作者知识浅谈CSDN签约讲师CSDN博客专家华为云云享专家阿里云专家博主 擅长领域全栈工程师、爬虫、ACM算法 公众号知识浅谈 网站vip.zsqt.cc SpringSecurity结合knife4j实现swagger文档 正菜来了 引入依赖 dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-security/artifactId /dependencydependencygroupIdcom.github.xiaoymin/groupIdartifactIdknife4j-spring-boot-starter/artifactIdversion3.0.3/version/dependencyswagger配置 spring:mvc:pathmatch:matching-strategy: ant_path_matcher配置类 package com.zsqt.security.config;import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.service.ApiInfo; import springfox.documentation.service.Contact; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2;/*** author: YinLei* Package: com.zsqt.security.config* date: 2024/1/4 14:29* Description:* version: 1.0*/ Configuration EnableSwagger2 public class SwaggerConfiguration {Beanpublic Docket createDocApi() {return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.any()).paths(PathSelectors.any()).build().groupName(接口文档).pathMapping(/).apiInfo(DocApi());}/*** 构建 api文档的详细信息函数,注意这里的注解引用的是哪个*/private ApiInfo DocApi() {return new ApiInfoBuilder()//页面标题.title(接口测试工具)//创建人.contact(new Contact(, , ))//版本号.version(1.0)//描述.description(接口测试工具).build();}} security放行 .antMatchers(/doc.html, /webjars/**, /v2/api-docs, /swagger-resources/**).permitAll() Slf4j EnableWebSecurity Configuration RequiredArgsConstructor public class SecurityConfiguration {private final JwtAuthenticationFilter jwtFilter; // 注入JwtAuthenticationFilterprivate final JwtUtil jwtUtil; // 注入JwtUtilAutowiredprivate CustUserServiceImpl custUserService;Beanpublic BCryptPasswordEncoder passwordEncoder(){return new BCryptPasswordEncoder();}/*** 获取AuthenticationManager 登录验证的时候使用* param authenticationConfiguration* return* throws Exception*/Beanpublic AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration) throws Exception {return authenticationConfiguration.getAuthenticationManager();}Beanpublic SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {return http.authorizeHttpRequests((authz)-authz.antMatchers(/user/login).permitAll() // 允许匿名用户访问login.antMatchers(/user/logout).permitAll() // 允许匿名用户访问logout.antMatchers(/doc.html, /webjars/**, /v2/api-docs, /swagger-resources/**).permitAll().anyRequest().authenticated()) // 其他请求必须经过身份验证.csrf(AbstractHttpConfigurer::disable) // 禁用csrf.cors(conf-conf.configurationSource(corsConfigurationSource())) // 配置跨域.sessionManagement(conf-conf.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) // 禁用session.addFilterBefore(jwtFilter, UsernamePasswordAuthenticationFilter.class)//指定过滤器.build();}}总结 大功告成撒花致谢关注我不迷路带你起飞带你富。 Writted By 知识浅谈
http://www.pierceye.com/news/352396/

相关文章:

  • wap手机网站建设刀模 东莞网站建设
  • 怎样做网站的外链做推广优化的网站有哪些内容
  • 永嘉规划建设局网站备案个人网站做淘宝客
  • 枣庄网站建设电话网站怎么做 凡科
  • 视频网站点击链接怎么做的宁波网站建设接单
  • 网站报价表怎么做wordpress 横向扩展
  • 溧阳网站建设哪家好网站建设的教程
  • 360怎么做网站做pop网站
  • 网站建设方案书2000字中国正国级名单
  • 企业网站的布局类型网站移动页面怎么做的
  • 人是用什么做的视频网站吗wordpress如何设水印图片
  • 蛋糕店的网站建设咋写深圳市宝安区邮政编码
  • 东莞横沥网站建设杭州网站制作排名
  • 百合怎么做网站网站开发语
  • 网站搭建哪里找最好天津市建设工程信息网站
  • 有免费注册网站吗做教育网站还挣钱吗
  • 网站做百度推广需要哪些条件店铺推广软文范例
  • 台州企业网站搭建特点迅美网站建设
  • 做营销网站推广官方网站建设方法
  • 网页设计精选网站网站查询功能怎么做
  • 重庆专业网站推广流程建立平台的步骤
  • 舟山市普陀区建设局网站net网站开发 兼职
  • 网站备案流程阿里云南宁网站建设官网
  • h5网站制作介绍简单的静态 新闻 asp 网站源码
  • 济南seo网站推广公司帮别人做彩票网站吗
  • 郑州市网站建设怎么样wordpress wp editor
  • 台州网站建设 推广公司网络营销课程总结范文
  • 网站 外包 版权杭州做官网的有哪些公司
  • 微信网站html5中山平面设计公司
  • 建站网站教程视频世界网站排名