摘要: 1、添加以下配置 <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>2.3.4.RELEA 阅读全文
posted @ 2025-08-05 14:22 Commissar-Xia 阅读(51) 评论(0) 推荐(0)
摘要: 当需要iframe跨站嵌入引用时,如果需要传递Cookie,则离不开SameSite 属性。 SameSite 属性有三个值,分别是: 1、Strict 仅容许一方请求携带 Cookie,即浏览器将只发送相同站点请求的 Cookie,即当前网页 URL 与请求目标 URL 彻底一致。2、Lax 容许 阅读全文
posted @ 2025-08-05 10:06 Commissar-Xia 阅读(589) 评论(0) 推荐(1)
摘要: 最近在做微服务不停服迁移,为了保证服务在迁移过程中不影响系统的正常使用,还要保证客户无感迁移。 所以在两个机房搭建了Consul注册中心服务,使用官网推荐的模式进行搭建,搭建步骤省略,仅针对应用服务的改造: 原Consul是支持跨数据中心调用的,但是需要通过配置来指定目标服务所在的数据中心,如果是个 阅读全文
posted @ 2025-07-15 18:44 Commissar-Xia 阅读(73) 评论(0) 推荐(0)
摘要: 阿里的Druid数据库连接池其实是支持用户名密码做加密处理的,有对应的callback配置, 官网中有相应介绍,详见:https://github.com/alibaba/druid/wiki/DruidDataSource配置属性列表 官网中只介绍了密码加密,根据源码发现用户名也是支持加密的,只是 阅读全文
posted @ 2025-07-15 14:29 Commissar-Xia 阅读(169) 评论(0) 推荐(0)
摘要: 当请求静态资源文件时,如出现以下错误:Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "application/octet-s 阅读全文
posted @ 2025-04-11 22:22 Commissar-Xia 阅读(631) 评论(0) 推荐(0)
摘要: 将ES中long类型的日期时间戳转为日期格式进行分组统计。{ "size": 0, "query": { "bool": { "must": [ { "range": { "crawltime": { "from": 1730706212000, "to": 1733298205474, "incl 阅读全文
posted @ 2024-12-05 11:40 Commissar-Xia 阅读(198) 评论(0) 推荐(0)
摘要: 出现以下错误,是因为项目缺少依赖: at org.springframework.boot.logging.logback.LogbackLoggingSystem.reportConfigurationErrorsIfNecessary(LogbackLoggingSystem.java:189) 阅读全文
posted @ 2024-09-05 17:05 Commissar-Xia 阅读(396) 评论(0) 推荐(0)
摘要: 在使用Maven3.9.6构建项目时,出现以下错误: [INFO] [INFO] resources:3.3.1:resources (default-resources) @ service-sample [INFO] Copying 18 resources from src/main/java 阅读全文
posted @ 2024-02-07 10:47 Commissar-Xia 阅读(859) 评论(0) 推荐(0)
摘要: 以下配置可以完美解决同一时间触发定时任务,在实际执行中存在时间差的问题:比如: @Scheduled(cron = "0 0/10 * * * ?") public void task1(){ log.info("task1 started"); ........ } @Scheduled(cron 阅读全文
posted @ 2022-04-13 23:36 Commissar-Xia 阅读(626) 评论(0) 推荐(0)
摘要: 最近在给同事调试项目时,发现一个问题,在Security Success 回调逻辑中调用RequestContextHolder.currentRequestAttributes() 出现报错: caused by :java.lang.IllegalStateException: No threa 阅读全文
posted @ 2021-05-12 14:12 Commissar-Xia 阅读(6828) 评论(0) 推荐(0)