Compare commits

..

6 Commits

Author SHA1 Message Date
曾文豪
32fb562775 publish 0.8.5 2023-03-14 14:20:56 +08:00
曾文豪
af50468743 perf: 调整token校验 2023-03-14 14:20:23 +08:00
曾文豪
cab794ecc4 Merge branch 'test-uploadDir' into 'master'
GlobalConfig新加uploadDir配置

See merge request tiesheng/tiesheng!2
2023-03-14 06:10:02 +00:00
‘毛文春’
0c511940aa GlobalConfig新加uploadDir配置 2023-03-14 14:03:53 +08:00
‘毛文春’
60dea50e43 修改 过滤不要需要验证的接口(path) 2023-03-14 14:01:11 +08:00
‘毛文春’
cbfeb09a22 修改 过滤不要需要验证的接口(path) 2023-03-13 17:45:29 +08:00
19 changed files with 56 additions and 64 deletions

View File

@@ -1,25 +0,0 @@
## 工作流触发时机
on:
push:
tags:
- '*'
jobs:
## 任务名称
local-deploy:
## 任务执行的服务器
runs-on: tiesheng-local
## 任务步骤
steps:
## 检出代码(固定配置)
- name: Check out repository code
uses: https://git.tieshengkeji.com/actions/checkout@v4
## maven打包
- name: Maven deploy
run: |
mvn deploy

1
.gitignore vendored
View File

@@ -6,4 +6,3 @@ rebel.xml
/static/ /static/
/config/ /config/
/runtime/ /runtime/
.DS_Store

33
pom.xml
View File

@@ -6,7 +6,7 @@
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>springboot-parent</name> <name>springboot-parent</name>
<description>杭州铁晟科技有限公司基础依赖</description> <description>杭州铁晟科技有限公司基础依赖</description>
@@ -57,55 +57,55 @@
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-database</artifactId> <artifactId>springboot-database</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-login</artifactId> <artifactId>springboot-login</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-web</artifactId> <artifactId>springboot-web</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-util</artifactId> <artifactId>springboot-util</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-platform</artifactId> <artifactId>springboot-platform</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-message</artifactId> <artifactId>springboot-message</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-encrypt</artifactId> <artifactId>springboot-encrypt</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-annotation</artifactId> <artifactId>springboot-annotation</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-poi</artifactId> <artifactId>springboot-poi</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -125,25 +125,18 @@
<pluginRepositories> <pluginRepositories>
<pluginRepository> <pluginRepository>
<id>tiesheng-repo-plugin</id> <id>kepai-repo-plugin</id>
<url>https://git.tieshengkeji.com/api/packages/tieshengkeji/maven</url> <url>http://git.kepai365.com/zeng_wenhao/kepai-repo/raw/master</url>
</pluginRepository> </pluginRepository>
</pluginRepositories> </pluginRepositories>
<distributionManagement>
<repository>
<id>gitea</id>
<url>https://git.tieshengkeji.com/api/packages/tieshengkeji/maven</url>
</repository>
</distributionManagement>
<build> <build>
<pluginManagement> <pluginManagement>
<plugins> <plugins>
<plugin> <plugin>
<groupId>com.tiesheng.springboot-plugin</groupId> <groupId>com.tiesheng.springboot-plugin</groupId>
<artifactId>tiesheng-maven-plugin</artifactId> <artifactId>tiesheng-maven-plugin</artifactId>
<version>1.0.0</version> <version>0.0.5</version>
<executions> <executions>
<execution> <execution>
<goals> <goals>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
</parent> </parent>
<artifactId>springboot-ademo</artifactId> <artifactId>springboot-ademo</artifactId>
@@ -29,8 +29,8 @@
<repositories> <repositories>
<repository> <repository>
<id>tiesheng-repo</id> <id>kepai-repo</id>
<url>https://git.tieshengkeji.com/api/packages/tieshengkeji/maven</url> <url>http://git.kepai365.com/zeng_wenhao/kepai-repo/raw/master</url>
</repository> </repository>
</repositories> </repositories>

View File

@@ -41,7 +41,6 @@ public class TestController {
@RequestMapping("/index") @RequestMapping("/index")
@TokenIgnore
public ApiResp<String> index() { public ApiResp<String> index() {
TokenBean tokenBean = new TokenBean("11", "", "fdfd"); TokenBean tokenBean = new TokenBean("11", "", "fdfd");
@@ -67,7 +66,6 @@ public class TestController {
@RequestMapping("/export") @RequestMapping("/export")
@TokenIgnore
public ApiResp<String> export() { public ApiResp<String> export() {
// List<TestFile> list = new ArrayList<>(); // List<TestFile> list = new ArrayList<>();

View File

@@ -20,3 +20,7 @@ spring:
logging: logging:
file: file:
name: runtime/logs/tiesheng.log name: runtime/logs/tiesheng.log
tiesheng:
token:
ignore-paths:
- /test/index

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
</parent> </parent>
<artifactId>springboot-annotation</artifactId> <artifactId>springboot-annotation</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
</parent> </parent>
<artifactId>springboot-database</artifactId> <artifactId>springboot-database</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
</parent> </parent>
<artifactId>springboot-encrypt</artifactId> <artifactId>springboot-encrypt</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
</parent> </parent>
<artifactId>springboot-login</artifactId> <artifactId>springboot-login</artifactId>

View File

@@ -1,5 +1,6 @@
package com.tiesheng.login.config.token; package com.tiesheng.login.config.token;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.tiesheng.annotation.token.TokenIgnore; import com.tiesheng.annotation.token.TokenIgnore;
import com.tiesheng.util.ServletKit; import com.tiesheng.util.ServletKit;
@@ -50,8 +51,18 @@ public class TsTokenAspect {
// 过滤不要需要验证的接口path // 过滤不要需要验证的接口path
String requestURI = ServletKit.getRequest().getRequestURI(); String requestURI = ServletKit.getRequest().getRequestURI();
if (StrUtil.startWithAnyIgnoreCase(requestURI, tsTokenConfig.getIgnorePaths())) { String[] ignorePaths = tsTokenConfig.getIgnorePaths();
return; if (ObjUtil.isNotEmpty(ignorePaths)) {
for (String path : ignorePaths) {
if (path.contains("/**") &&
StrUtil.startWith(requestURI, path.replace("/**", ""))) {
// 通配路径
return;
} else if (requestURI.equals(path)) {
// 完整路径
return;
}
}
} }
// 过滤不要需要验证的接口(注解) // 过滤不要需要验证的接口(注解)

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
</parent> </parent>
<artifactId>springboot-message</artifactId> <artifactId>springboot-message</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
</parent> </parent>
<artifactId>springboot-platform</artifactId> <artifactId>springboot-platform</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
</parent> </parent>
<artifactId>springboot-poi</artifactId> <artifactId>springboot-poi</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
</parent> </parent>
<artifactId>springboot-util</artifactId> <artifactId>springboot-util</artifactId>

View File

@@ -23,6 +23,7 @@ public class GlobalConfig {
private String host; private String host;
private String service; private String service;
private String version; private String version;
private String uploadDir = System.getProperty("user.dir");
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// 逻辑方法 // 逻辑方法
@@ -80,6 +81,15 @@ public class GlobalConfig {
// setter\getter // setter\getter
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
public String getUploadDir() {
return uploadDir;
}
public void setUploadDir(String uploadDir) {
this.uploadDir = uploadDir;
}
public String getHost() { public String getHost() {
return host; return host;
} }

View File

@@ -16,7 +16,7 @@ import javax.annotation.PostConstruct;
@ConfigurationProperties(prefix = "tiesheng.ip2region") @ConfigurationProperties(prefix = "tiesheng.ip2region")
public class Ip2regionConfig { public class Ip2regionConfig {
private String dbUrl = "https://git.tieshengkeji.com/tieshengkeji/Ip2region/raw/branch/main/ip2region.xdb"; private String dbUrl = "http://git.kepai365.com/zeng_wenhao/kepai-repo/raw/master/ipdb/ip2region.xdb";
private String dbPath = System.getProperty("user.dir") + "/runtime/ip2region/ip2region.xdb"; private String dbPath = System.getProperty("user.dir") + "/runtime/ip2region/ip2region.xdb";
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////

View File

@@ -5,7 +5,9 @@ import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.CharUtil; import cn.hutool.core.util.CharUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.spring.SpringUtil;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import com.tiesheng.util.config.GlobalConfig;
public class FileUploadPath { public class FileUploadPath {
@@ -46,7 +48,7 @@ public class FileUploadPath {
} }
pathBean.setHttpPath(tempPath); pathBean.setHttpPath(tempPath);
String tempAbs = String.format("%s/static%s", System.getProperty("user.dir"), tempPath); String tempAbs = String.format("%s/static%s", SpringUtil.getBean(GlobalConfig.class).getUploadDir(), tempPath);
tempAbs = FileUtil.normalize(tempAbs); tempAbs = FileUtil.normalize(tempAbs);
pathBean.setAbsolutePath(tempAbs); pathBean.setAbsolutePath(tempAbs);

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.8.4</version> <version>0.8.5</version>
</parent> </parent>
<artifactId>springboot-web</artifactId> <artifactId>springboot-web</artifactId>