diff --git a/pigx-auth/src/main/java/com/pig4cloud/pigx/auth/endpoint/PigxTokenEndpoint.java b/pigx-auth/src/main/java/com/pig4cloud/pigx/auth/endpoint/PigxTokenEndpoint.java index 8422580d8..64cf631b5 100644 --- a/pigx-auth/src/main/java/com/pig4cloud/pigx/auth/endpoint/PigxTokenEndpoint.java +++ b/pigx-auth/src/main/java/com/pig4cloud/pigx/auth/endpoint/PigxTokenEndpoint.java @@ -140,4 +140,15 @@ public class PigxTokenEndpoint { return dealService.queryToken(page); } + /** + * 查询token + * @param token + * @return + */ + @Inner + @GetMapping("/query-token") + public R queryToken(String token) { + return dealService.queryTokenInfo(token); + } + } diff --git a/pigx-auth/src/main/java/com/pig4cloud/pigx/auth/service/PigxTokenDealServiceImpl.java b/pigx-auth/src/main/java/com/pig4cloud/pigx/auth/service/PigxTokenDealServiceImpl.java index 37d26e785..7db16c0f8 100644 --- a/pigx-auth/src/main/java/com/pig4cloud/pigx/auth/service/PigxTokenDealServiceImpl.java +++ b/pigx-auth/src/main/java/com/pig4cloud/pigx/auth/service/PigxTokenDealServiceImpl.java @@ -150,4 +150,9 @@ public class PigxTokenDealServiceImpl { return result; } + public R queryTokenInfo(String token) { + OAuth2AccessToken oAuth2AccessToken = tokenStore.readAccessToken(token); + return R.ok(oAuth2AccessToken); + } + } diff --git a/pigx-common/pigx-common-bom/pom.xml b/pigx-common/pigx-common-bom/pom.xml index df0880845..c2a1bf543 100644 --- a/pigx-common/pigx-common-bom/pom.xml +++ b/pigx-common/pigx-common-bom/pom.xml @@ -21,7 +21,7 @@ 3.5.1 3.4.1 1.2.8 - 5.7.21 + 5.7.22 8.0.27 21.3.0.0 8.4.1.jre8 diff --git a/pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/feign/RemoteTokenService.java b/pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/feign/RemoteTokenService.java index 3af5f261a..20f4eba1a 100644 --- a/pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/feign/RemoteTokenService.java +++ b/pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/feign/RemoteTokenService.java @@ -23,10 +23,7 @@ import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants; import com.pig4cloud.pigx.common.core.util.R; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.SpringQueryMap; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.*; import java.util.Map; @@ -58,4 +55,13 @@ public interface RemoteTokenService { @DeleteMapping("/token/{token}") R removeTokenById(@PathVariable("token") String token, @RequestHeader(SecurityConstants.FROM) String from); + /** + * 校验令牌获取用户信息 + * @param token + * @param from + * @return + */ + @GetMapping("/token/query-token") + R queryToken(@RequestParam("token") String token, @RequestHeader(SecurityConstants.FROM) String from); + } diff --git a/pigx-visual/pigx-jimu-platform/Dockerfile b/pigx-visual/pigx-jimu-platform/Dockerfile new file mode 100644 index 000000000..550f1b9a0 --- /dev/null +++ b/pigx-visual/pigx-jimu-platform/Dockerfile @@ -0,0 +1,18 @@ +FROM pig4cloud/java:8-jre + +MAINTAINER wangiegie@gmail.com + +ENV TZ=Asia/Shanghai +ENV JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom" + +RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN mkdir -p /pigx-jimu-platform + +WORKDIR /pigx-jimu-platform + +EXPOSE 5008 + +ADD ./target/pigx-jimu-platform.jar ./ + +CMD sleep 120;java $JAVA_OPTS -jar pigx-jimu-platform.jar diff --git a/pigx-visual/pigx-jimu-platform/pom.xml b/pigx-visual/pigx-jimu-platform/pom.xml new file mode 100755 index 000000000..558d4130f --- /dev/null +++ b/pigx-visual/pigx-jimu-platform/pom.xml @@ -0,0 +1,94 @@ + + + 4.0.0 + + com.pig4cloud + pigx-visual + 4.3.0 + + + pigx-jimu-platform + jar + + 积木报表系统 + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + com.pig4cloud + pigx-common-sentinel + + + + com.pig4cloud + pigx-common-feign + + + + com.pig4cloud + pigx-upms-api + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-undertow + + + org.jeecgframework.jimureport + jimureport-spring-boot-starter + ${jimu.version} + + + + com.alibaba + druid-spring-boot-starter + + + + mysql + mysql-connector-java + + + + com.oracle.database.jdbc + ojdbc8 + + + + org.postgresql + postgresql + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + io.fabric8 + docker-maven-plugin + + false + + + + + diff --git a/pigx-visual/pigx-jimu-platform/src/main/java/com/pig4cloud/pigx/bi/PigxJimuApplication.java b/pigx-visual/pigx-jimu-platform/src/main/java/com/pig4cloud/pigx/bi/PigxJimuApplication.java new file mode 100755 index 000000000..d56bf5be4 --- /dev/null +++ b/pigx-visual/pigx-jimu-platform/src/main/java/com/pig4cloud/pigx/bi/PigxJimuApplication.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2025, lengleng All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the pig4cloud.com developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: lengleng (wangiegie@gmail.com) + */ + +package com.pig4cloud.pigx.bi; + +import com.pig4cloud.pigx.common.feign.annotation.EnablePigxFeignClients; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; + +/** + * @author lengleng + * @date 2022-04-06 + *

+ */ +@EnablePigxFeignClients +@EnableDiscoveryClient +@SpringBootApplication(scanBasePackages = { "org.jeecg.modules.jmreport", "com.pig4cloud.pigx.bi" }, + exclude = MongoAutoConfiguration.class) +public class PigxJimuApplication { + + public static void main(String[] args) { + SpringApplication.run(PigxJimuApplication.class, args); + } + +} diff --git a/pigx-visual/pigx-jimu-platform/src/main/java/com/pig4cloud/pigx/bi/config/JimuReportTokenService.java b/pigx-visual/pigx-jimu-platform/src/main/java/com/pig4cloud/pigx/bi/config/JimuReportTokenService.java new file mode 100644 index 000000000..edab3658c --- /dev/null +++ b/pigx-visual/pigx-jimu-platform/src/main/java/com/pig4cloud/pigx/bi/config/JimuReportTokenService.java @@ -0,0 +1,43 @@ +package com.pig4cloud.pigx.bi.config; + +import com.pig4cloud.pigx.admin.api.feign.RemoteTokenService; +import com.pig4cloud.pigx.common.core.constant.CommonConstants; +import com.pig4cloud.pigx.common.core.constant.SecurityConstants; +import com.pig4cloud.pigx.common.core.util.R; +import lombok.RequiredArgsConstructor; +import org.jeecg.modules.jmreport.api.JmReportTokenServiceI; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * @author lengleng + * @date 2022/4/6 + * + * 积木安全控制 + */ +@Component +@RequiredArgsConstructor +public class JimuReportTokenService implements JmReportTokenServiceI { + + private final RemoteTokenService tokenService; + + @Override + public String getUsername(String token) { + R> result = tokenService.queryToken(token, SecurityConstants.FROM_IN); + if (CommonConstants.SUCCESS.equals(result.getCode())) { + return (String) result.getData().get("username"); + } + return null; + } + + @Override + public Boolean verifyToken(String token) { + R> result = tokenService.queryToken(token, SecurityConstants.FROM_IN); + if (CommonConstants.SUCCESS.equals(result.getCode())) { + return true; + } + return false; + } + +} diff --git a/pigx-visual/pigx-jimu-platform/src/main/resources/application.yml b/pigx-visual/pigx-jimu-platform/src/main/resources/application.yml new file mode 100644 index 000000000..98050e988 --- /dev/null +++ b/pigx-visual/pigx-jimu-platform/src/main/resources/application.yml @@ -0,0 +1,19 @@ +server: + port: 5008 + +spring: + application: + name: @artifactId@ + cloud: + nacos: + discovery: + server-addr: ${NACOS_HOST:pigx-register}:${NACOS_PORT:8848} + service: @artifactId@ + config: + server-addr: ${spring.cloud.nacos.discovery.server-addr} + config: + import: + - optional:nacos:application-${spring.profiles.active}.yml + - optional:nacos:${spring.application.name}-${spring.profiles.active}.yml + profiles: + active: @profiles.active@ diff --git a/pigx-visual/pigx-jimu-platform/src/main/resources/logback-spring.xml b/pigx-visual/pigx-jimu-platform/src/main/resources/logback-spring.xml new file mode 100644 index 000000000..5b4213c6f --- /dev/null +++ b/pigx-visual/pigx-jimu-platform/src/main/resources/logback-spring.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + ${CONSOLE_LOG_PATTERN} + + + + + + ${log.path}/debug.log + + ${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz + 50MB + 30 + + + %date [%thread] %-5level [%logger{50}] %file:%line - %msg%n + + + + + + ${log.path}/error.log + + ${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz + 50MB + 30 + + + %date [%thread] %-5level [%logger{50}] %file:%line - %msg%n + + + ERROR + + + + + + + + + + + + + diff --git a/pigx-visual/pom.xml b/pigx-visual/pom.xml index defa94cfd..13cd9b211 100644 --- a/pigx-visual/pom.xml +++ b/pigx-visual/pom.xml @@ -19,31 +19,32 @@ --> - 4.0.0 - - com.pig4cloud - pigx - 4.3.0 - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + com.pig4cloud + pigx + 4.3.0 + - pigx-visual - pigx 图形化功能模块 - pom + pigx-visual + pigx 图形化功能模块 + pom - - pigx-bi-platform - pigx-codegen - pigx-daemon-elastic-job - pigx-daemon-quartz - pigx-oa-platform - pigx-pay-platform - pigx-report-platform - pigx-monitor - pigx-mp-platform - pigx-sso-client-demo - pigx-sentinel-dashboard - pigx-tx-manager - pigx-xxl-job-admin - + + pigx-bi-platform + pigx-codegen + pigx-daemon-elastic-job + pigx-daemon-quartz + pigx-jimu-platform + pigx-oa-platform + pigx-pay-platform + pigx-report-platform + pigx-monitor + pigx-mp-platform + pigx-sso-client-demo + pigx-sentinel-dashboard + pigx-tx-manager + pigx-xxl-job-admin + diff --git a/pom.xml b/pom.xml index c7a9aa9c5..8cc3764ea 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 3.0.3 2.11.4 2.2.9 - 1.4.32 + 1.4.4-beta 1.11.543 2.3.0 5.22.0