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

男人和女人做羞羞的事情网站如何申请域名空间

男人和女人做羞羞的事情网站,如何申请域名空间,安徽建设工程信息平台,安丘网站建设报价目录 1.引入相关的依赖 2.nacos的yaml的相关配置#xff0c;配置密码和相关算法 3.配置数据源连接 3.1 数据库连接配置 4.连接数据库配置类详解#xff08;DataSourceConfig#xff09;。 5.完整的配置类代码如下 1.引入相关的依赖 dependencygroupId…目录 1.引入相关的依赖 2.nacos的yaml的相关配置配置密码和相关算法 3.配置数据源连接 3.1 数据库连接配置 4.连接数据库配置类详解DataSourceConfig。 5.完整的配置类代码如下 1.引入相关的依赖 dependencygroupIdcom.github.ulisesbocchio/groupIdartifactIdjasypt-spring-boot-starter/artifactIdversion3.0.3/version/dependency 2.nacos的yaml的相关配置配置密码和相关算法 jasypt:encryptor:algorithm: PBEWithHmacSHA512AndAES_256password: encryptionkey 3.配置数据源连接 3.1 数据库连接配置 使用ConfigurationProperties(prefix spring.datasource)注解的dataSource()方法通过DataSourceBuilder.create().build();创建了一个DataSource的bean。这个bean的配置信息来自于application.properties或application.yml文件中的spring.datasource前缀下的配置项比如数据库URL、用户名、密码等。 重点: 密码在yaml是加密的,如ENC(N8VBWG5nOHvy5efX3/mlPAmdBykE7iDZFl362LyeaPRXMbLT0PzEIlB/KDXrNYz6)配置了jasypt之后使用password作为密钥进行加密解密。 #加密 jasypt:encryptor:algorithm: PBEWithHmacSHA512AndAES_256password: encryptionkey spring: datasource:driver-class-name: com.mysql.cj.jdbc.Driverjdbc-url: jdbc:mysql://localhost:3306/auth?serverTimezoneAsia/ShanghaiuseUnicodetruecharacterEncodingutf-8allowMultiQueriestruenullCatalogMeansCurrenttrueusername: rootpassword: ENC(N8VBWG5nOHvy5efX3/mlPAmdBykE7iDZFl362LyeaPRXMbLT0PzEIlB/KDXrNYz6)type: com.alibaba.druid.pool.DruidDataSourcedruid:initial-size: 5min-idle: 1max-active: 10max-wait: 60000validation-query: SELECT 1 FROM DUALtest-on-borrow: falsetest-on-return: falsetest-while-idle: truetime-between-eviction-runs-millis: 60000redis:port: 6379 mysql:driver: com.mysql.jdbc.driver 4.连接数据库配置类详解DataSourceConfig。 通过配置类的方式实现数据库的连接构建StringEncryptor 的bean对象实现密码的加密解密把加密解密串放到配置文件中用ENC()包裹着加载配置文件的时候有ENC()就会自动解密这样避免配置文件密码泄露的风险。 Beanpublic StringEncryptor stringEncryptor() {PooledPBEStringEncryptor encryptor new PooledPBEStringEncryptor();SimpleStringPBEConfig config new SimpleStringPBEConfig();config.setPassword(encryptionkey); // 加密密钥config.setAlgorithm(PBEWithHmacSHA512AndAES_256);config.setKeyObtentionIterations(1000);config.setPoolSize(1);config.setProviderName(SunJCE);config.setSaltGeneratorClassName(org.jasypt.salt.RandomSaltGenerator);config.setStringOutputType(base64);encryptor.setConfig(config);return encryptor;} 5.完整的配置类代码如下 package com.example.auth.config;import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean; import org.apache.ibatis.session.SqlSessionFactory; import org.jasypt.encryption.StringEncryptor; import org.jasypt.encryption.pbe.PooledPBEStringEncryptor; import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig; import org.mybatis.spring.annotation.MapperScan; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.support.PathMatchingResourcePatternResolver;import javax.annotation.PostConstruct; import javax.sql.DataSource;/*** MybatisPlus配置类 数据库连接*/ Configuration MapperScan(basePackages com.example.auth.mapper) public class DataSourceConfig {Autowiredprivate StringEncryptor stringEncryptor;ConfigurationProperties(prefix spring.datasource)Beanpublic DataSource dataSource() {return DataSourceBuilder.create().build();}Beanpublic MybatisPlusInterceptor mybatisPlusInterceptor() {MybatisPlusInterceptor interceptor new MybatisPlusInterceptor();//分页插件interceptor.addInnerInterceptor(new PaginationInnerInterceptor());//注册乐观锁插件interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());return interceptor;}Beanpublic SqlSessionFactory sqlSessionFactory(DataSource dataSource, MybatisPlusInterceptor interceptor) throws Exception {MybatisSqlSessionFactoryBean ssfb new MybatisSqlSessionFactoryBean();ssfb.setDataSource(dataSource);ssfb.setPlugins(interceptor);//到哪里找xml文件ssfb.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(classpath:/mapper/*Mapper.xml));return ssfb.getObject();}Beanpublic StringEncryptor stringEncryptor() {PooledPBEStringEncryptor encryptor new PooledPBEStringEncryptor();SimpleStringPBEConfig config new SimpleStringPBEConfig();config.setPassword(encryptionkey); // 加密密钥config.setAlgorithm(PBEWithHmacSHA512AndAES_256);config.setKeyObtentionIterations(1000);config.setPoolSize(1);config.setProviderName(SunJCE);config.setSaltGeneratorClassName(org.jasypt.salt.RandomSaltGenerator);config.setStringOutputType(base64);encryptor.setConfig(config);return encryptor;}PostConstructpublic void init(){/* String enStr stringEncryptor.encrypt(Root123);String deSTr stringEncryptor.decrypt(N8VBWG5nOHvy5efX3/mlPAmdBykE7iDZFl362LyeaPRXMbLT0PzEIlB/KDXrNYz6);System.out.println(enStrenStr);System.out.println(deSTrdeSTr);*/}}你们的点赞和赞赏是我继续前进的动力谢谢。
http://www.hkea.cn/news/14336367/

相关文章:

  • wordpress 4.9 站群网站前端设计培训
  • 网站建设运营费用包括哪些如何识别一个网站是否做的好
  • 博客做资讯类网站网站在百度上做推广怎样做
  • 网站查询功能怎么做2024年还有新冠吗
  • 在小型网站建设小组中答案免费推广软件平台seo博客
  • 简单网站建设运营wordpress跳过短代码
  • 做云购网站研发外包
  • 网站备案空间备案吗网站如何推广引流
  • 通常做网站要多久wordpress获取权限
  • 如何上传文件到网站商场设计规范
  • 有没有代做ppt的网站网店设计流程图
  • 可以做黄金期权的网站深圳搜索引擎优化收费
  • 珠海手机网站开发wordpress thegem
  • 具有价值的做pc端网站自己做网站需要学些什么
  • 怎么做网站运营帮企业做网站前景怎么样
  • 太原网站制作报价网站开发语言 .net
  • 制作网站主题涉密网络运行维护服务外包的单位
  • 免费发布的网站wordpress 简码大全
  • python人网站开发案例网络公司经营范围开发属于制造吗
  • 呼伦贝尔网站建设公司互联网营销行业
  • 网站运营与建设 教学大纲营销网站建设制作
  • 舆情网站网站建设 网站
  • cms网站建设教程建设网站的网页设计
  • 北京网站设计的公司ps网站头部
  • 中山制作网站的公司开发一个跑腿app需要多少钱
  • 常德网站优化哪家好外国服务器的网站
  • 城乡建设招投标网站网站推广实施方案
  • 旅游模板网站成都达洱狐网络科技有限公司
  • 千博企业网站宁阳网站建设
  • 网站建设服务哪家好 价格多少钱百达翡丽手表网站