Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
architecture
/
glsx-archetype
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3108ef50
authored
Apr 20, 2023
by
刘宇峰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
框架完善
1 parent
f6650266
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
9 deletions
rest-archetype-framework/rest-admin-common/src/main/java/com/glsx/plat/common/utils/StringUtils.java
rest-archetype-framework/rest-admin-elasticjob/pom.xml
rest-archetype-framework/rest-admin-common/src/main/java/com/glsx/plat/common/utils/StringUtils.java
View file @
3108ef5
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
*/
*/
package
com
.
glsx
.
plat
.
common
.
utils
;
package
com
.
glsx
.
plat
.
common
.
utils
;
import
org.springframework.util.AntPathMatcher
;
import
java.io.*
;
import
java.io.*
;
import
java.util.*
;
import
java.util.*
;
...
@@ -145,6 +147,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
...
@@ -145,6 +147,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
/**
/**
* 将null转空字符串
* 将null转空字符串
*
* @param origin
* @param origin
* @return
* @return
*/
*/
...
@@ -255,15 +258,41 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
...
@@ -255,15 +258,41 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
return
false
;
return
false
;
}
}
/**
* 判断当前访问的url是否开头URI是在配置的忽略url列表中
*
* @param url
* @return
*/
public
static
boolean
isMatchedStr
(
String
[]
skipAuthUrls
,
String
url
)
{
if
(
StringUtils
.
isEmpty
(
url
))
{
return
false
;
}
if
(
Objects
.
isNull
(
skipAuthUrls
))
{
return
false
;
}
AntPathMatcher
matcher
=
new
AntPathMatcher
();
for
(
String
skipAuthUrl
:
skipAuthUrls
)
{
if
(
matcher
.
match
(
skipAuthUrl
,
url
))
{
return
true
;
}
}
return
false
;
}
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
public
static
<
T
>
T
cast
(
Object
obj
)
{
public
static
<
T
>
T
cast
(
Object
obj
)
{
return
(
T
)
obj
;
return
(
T
)
obj
;
}
}
// public static void main(String[] args) throws UnsupportedEncodingException {
// public static void main(String[] args) throws UnsupportedEncodingException {
// System.out.println("中文a".getBytes("UTF-8").length); //7
//// System.out.println("中文a".getBytes("UTF-8").length); //7
// System.out.println(getStrLength("中文a")); //7
//// System.out.println(getStrLength("中文a")); //7
// System.out.println("中文a".length()); //3
//// System.out.println("中文a".length()); //3
//
// String[] skipAuthUrls = new String[]{"/login/check", "/api/**", "/**/v3/api-docs", "/open/api/access/queryAccessToken"};
// boolean flag = isMatchedStr(skipAuthUrls, "/platform-shopmall/v3/api-docs");
// System.out.println(flag);
// }
// }
}
}
rest-archetype-framework/rest-admin-elasticjob/pom.xml
View file @
3108ef5
...
@@ -20,12 +20,6 @@
...
@@ -20,12 +20,6 @@
<dependency>
<dependency>
<groupId>
com.glsx
</groupId>
<groupId>
com.glsx
</groupId>
<artifactId>
rest-admin-context
</artifactId>
<artifactId>
rest-admin-context
</artifactId>
<exclusions>
<exclusion>
<groupId>
com.glsx
</groupId>
<artifactId>
rest-admin-jwt
</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.github.kuhn-he
</groupId>
<groupId>
com.github.kuhn-he
</groupId>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment