feat:整合ELK实现JWT强制下线的控制

This commit is contained in:
haoxr 2021-03-10 20:14:44 +08:00
parent d35c3f2396
commit 49f36e25ca
7 changed files with 19 additions and 18 deletions

View File

@ -31,7 +31,7 @@
## 项目地址
### 1. 体验
### 1. 体验 (小程序近期更新中...)
**商城管理平台访问地址:** [http://www.youlai.store](https://www.youlai.store/)
【有来小店】微信小程序体验码,扫描后申请体验看到直接通过

View File

@ -95,7 +95,7 @@
<version>1.0.0</version>
<executions>
<!--执行mvn package,即执行 mvn clean package docker:build-->
<!-- <execution>
<!--<execution>
<id>build-image</id>
<phase>package</phase>
<goals>
@ -120,7 +120,7 @@
<entryPoint>["java","-jar","${project.build.finalName}.jar"]</entryPoint>
<!-- 指定远程 Docker API地址 -->
<dockerHost>https://f.youlai.store:2376</dockerHost>
<dockerHost>http://f.youlai.store:2375</dockerHost>
<!-- 指定tls证书的目录 -->
<dockerCertPath>C:\cert\docker\f.youlai.store</dockerCertPath>

View File

@ -79,8 +79,12 @@ public class LoginRecordController {
List<LoginRecord> list = elasticSearchService.search(queryBuilder, sortBuilder, page, limit, LoginRecord.class, ESConstants.LOGIN_INDEX_PATTERN);
// 遍历获取会话状态
list.forEach(item->{
int tokenStatus = tokenService.getTokenStatus(item.getToken());
list.forEach(item -> {
String token = item.getToken();
int tokenStatus = 0;
if (StrUtil.isNotBlank(token)) {
tokenStatus = tokenService.getTokenStatus(item.getToken());
}
item.setStatus(tokenStatus);
});

View File

@ -155,13 +155,13 @@
<version>1.0.0</version>
<executions>
<!--执行mvn package,即执行 mvn clean package docker:build-->
<execution>
<!--<execution>
<id>build-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</execution>-->
</executions>
<configuration>

View File

@ -15,12 +15,7 @@ import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.client.core.CountRequest;
import org.elasticsearch.client.core.CountResponse;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.query.TermQueryBuilder;
import org.elasticsearch.index.reindex.BulkByScrollResponse;
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHits;
import org.elasticsearch.search.aggregations.AggregationBuilder;
@ -34,8 +29,10 @@ import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.search.sort.SortBuilder;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.*;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* @author hxr

View File

@ -128,13 +128,13 @@
<version>1.0.0</version>
<executions>
<!--执行mvn package,即执行 mvn clean package docker:build-->
<!--<execution>
<execution>
<id>build-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>-->
</execution>
</executions>
<configuration>
@ -155,7 +155,7 @@
<!-- 指定远程 Docker API地址 -->
<dockerHost>https://a.youlai.store:2376</dockerHost>
<!-- 指定tls证书的目录 -->
<dockerCertPath>C:\cert\docker\a.youlai.store</dockerCertPath>
<dockerCertPath>C:\certs\docker\a.youlai.store</dockerCertPath>
<!-- 复制 jar包到docker容器指定目录-->
<resources>

View File

@ -1,3 +1,3 @@
spring:
profiles:
active: dev
active: prod