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

网站在浏览器的图标怎么做济源网站建设电话

网站在浏览器的图标怎么做,济源网站建设电话,一个app软件,扬州建设工程交易网前言 最近想着把大火的deepseek 迁移到小程序里,基于刷题小程序的数据库做一个RAG应用,来进一步扩展答案解析,帮助用户解答相关问题。但是由于之前做的项目都要老了,并不支持spring 的AI模块,因此,我打算先…

前言

最近想着把大火的deepseek 迁移到小程序里,基于刷题小程序的数据库做一个RAG应用,来进一步扩展答案解析,帮助用户解答相关问题。但是由于之前做的项目都要老了,并不支持spring 的AI模块,因此,我打算先升级一下系统。

一、升级JDK 1.8 到 JDK 17

1、首先从官网上下载一个JDK17的包,windows系统可能有这两种包(压缩包和安装包)

直接下载压缩包,放在一个中文目录下,然后修改环境变量。 

 然后看一下java版本 java --version 是否修改成功。

 修改项目中的设置 如下

 

二、升级Springboot 2.x 到 Springboot 3.x  

 修改pom文件

    <parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>3.2.0</version><relativePath/></parent>
    <properties><java.version>17</java.version></properties>

这里面需要注意的东西还挺多的

1、javax.servlet.*相关的类找不到,需要切换依赖为jakarta.servlet。修改javax.servlet.*为jakarta.servlet.*。

		<!--jakarta.servlet start --><dependency><groupId>jakarta.servlet</groupId><artifactId>jakarta.servlet-api</artifactId></dependency><!--jakarta.servlet end -->

 2.、mybatis-plus-boot-starter

		<!-- mybatis-plus start--><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-spring-boot3-starter</artifactId><version>3.5.5</version></dependency><!-- mybatis-plus end-->

 3、redis

spring.data.redis.host=127.0.0.1
#Redis服务器连接端口
spring.data.redis.port=6379
#连接池最大连接数(使用负值表示没有限制)
spring.data.redis.lettuce.pool.max-active=20
#连接池最大阻塞等待时间(使用负值表示没有限制)
spring.data.redis.lettuce.pool.max-wait=-1
#连接池中的最大空闲连接
spring.data.redis.lettuce.pool.max-idle=5
#连接池中的最小空闲连接
spring.data.redis.lettuce.pool.min-idle=0
#连接超时时间(毫秒)
spring.data.redis.timeout=1800000

4、commons-pool2

Spring Boot 的 spring-boot-starter-data-redis 依赖了 Lettuce 作为 Redis 客户端。

Lettuce 依赖于 commons-pool2 来实现连接池功能。

因此我们也需要更新一下commons-pool2的版本。

        <dependency><groupId>org.apache.commons</groupId><artifactId>commons-pool2</artifactId><version>2.11.1</version></dependency>

4、Spring-Security 

咋WebSecurityConfig显示的注册authenticationManager为一个Bean

    @Beanpublic AuthenticationManager authenticationManager(AuthenticationConfiguration config) throws Exception {return config.getAuthenticationManager();}

使用SecurityFilterChain替代WebSecurityConfigurerAdapter;

@Beanpublic SecurityFilterChain securityFilterChain(HttpSecurity http,CustomizeAuthenticationEntryPoint customizeAuthenticationEntryPoint,CustomizeAccessDeniedHandler customizeAccessDeniedHandler) throws Exception {http.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED)).authenticationProvider(thirdLoginAuthenticationProvider).authorizeHttpRequests(authorize -> authorize.requestMatchers("/swagger-resources/configuration/ui","/swagger-resources","/swagger-resources/configuration/security","/swagger-ui.html",).permitAll().anyRequest().authenticated()).exceptionHandling(exception -> exception.accessDeniedHandler(customizeAccessDeniedHandler).authenticationEntryPoint(customizeAuthenticationEntryPoint)).cors(cors -> cors.configure(http)).csrf(csrf -> csrf.disable());return http.build();}

Spring-Security 6.x的版本中,对于session的管理也发生了一些变化,需要手动将 SecurityContext 保存到 HttpSession 中。

        HttpSession session = request.getSession();session.setAttribute(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY, SecurityContextHolder.getContext());

修改到这里位置,就可以启动项目了。

http://www.yayakq.cn/news/885506/

相关文章:

  • 地域购物网站网络营销推广的步骤
  • 广西建设培训中心网站vps 网站备案
  • 360神搜网站建设百度seo优化收费标准
  • 做情趣网站违法吗哪个网站做美食自媒体更好
  • 网站建设 聊城信息港加工钢球网架公司
  • 公众号做视频网站用织梦做网站需不需授权
  • jsp网站开发总结想做外贸怎么找客户
  • 东莞网站制作功能一个人可以做网站
  • 个人服务器网站备案wordpress扒主题代码
  • 怎么建设网站网页wordpress 古今
  • 中国建设银行网站荆门网点查询大连网站关键词排名
  • 网站维护要多久时间深圳品牌设计公司有哪些
  • 安安网站建设网站建设公司antnw
  • 哈尔滨建站系统点击查看seo竞价网站建设
  • 来宾住房和城乡建设网站长沙传媒公司排名
  • 网站图片的像素做网站需要到什么技术
  • 河南怎么样做网站版式设计排版
  • 互联网保险公司有哪几家wp系统网站如何做seo
  • 有用建站宝盒做网站的吗seo营销网站的设计标准
  • 南溪区网站建设项目管理证书 pmp
  • 装修网站排名前十哈尔滨门户网站制作哪家好
  • 平面设计网站培训中心网站重做 影响
  • 郫县网站制作网站编程论文
  • 各类专业网站建设公司找私人做网站
  • 中国空间站官网东莞房价二手房
  • 自建团体电子商务网站建设成本wordpress基础主题站
  • 门户网站指的是什么如何在网上推广自己的产品
  • 手机wap网站开发教程常德百度推广
  • 建网站可以铺货网络营销网站建设ppt
  • 泉州网站seo公司阿里云虚拟主机多网站吗