Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finance-manage
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
finance-oa
finance-manage
Commits
9fa3eac3
Commit
9fa3eac3
authored
May 26, 2022
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
升级fastjson到最新版2.0.4
parent
e320c50e
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
35 additions
and
38 deletions
+35
-38
pom.xml
pom.xml
+3
-3
ruoyi-common/pom.xml
ruoyi-common/pom.xml
+2
-2
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java
...in/java/com/ruoyi/common/core/domain/model/LoginUser.java
+1
-1
ruoyi-common/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java
...uoyi/common/exception/file/InvalidExtensionException.java
+1
-1
ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java
...src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java
+3
-2
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java
.../src/main/java/com/ruoyi/framework/aspectj/LogAspect.java
+1
-1
ruoyi-framework/src/main/java/com/ruoyi/framework/config/FastJson2JsonRedisSerializer.java
.../ruoyi/framework/config/FastJson2JsonRedisSerializer.java
+9
-14
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java
.../ruoyi/framework/interceptor/RepeatSubmitInterceptor.java
+2
-2
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java
...yi/framework/interceptor/impl/SameUrlDataInterceptor.java
+2
-2
ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java
...amework/security/handle/AuthenticationEntryPointImpl.java
+1
-1
ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java
...i/framework/security/handle/LogoutSuccessHandlerImpl.java
+1
-1
ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java
...java/com/ruoyi/generator/service/GenTableServiceImpl.java
+4
-4
ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java
...src/main/java/com/ruoyi/generator/util/VelocityUtils.java
+5
-4
No files found.
pom.xml
View file @
9fa3eac3
...
...
@@ -24,7 +24,7 @@
<kaptcha.version>
2.3.2
</kaptcha.version>
<mybatis-spring-boot.version>
2.2.2
</mybatis-spring-boot.version>
<pagehelper.boot.version>
1.4.1
</pagehelper.boot.version>
<fastjson.version>
1.2.83
</fastjson.version>
<fastjson.version>
2.0.4
</fastjson.version>
<oshi.version>
6.1.6
</oshi.version>
<commons.io.version>
2.11.0
</commons.io.version>
<commons.fileupload.version>
1.4
</commons.fileupload.version>
...
...
@@ -132,8 +132,8 @@
<!-- 阿里JSON解析器 -->
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<groupId>
com.alibaba
.fastjson2
</groupId>
<artifactId>
fastjson
2
</artifactId>
<version>
${fastjson.version}
</version>
</dependency>
...
...
ruoyi-common/pom.xml
View file @
9fa3eac3
...
...
@@ -61,8 +61,8 @@
<!-- 阿里JSON解析器 -->
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<groupId>
com.alibaba
.fastjson2
</groupId>
<artifactId>
fastjson
2
</artifactId>
</dependency>
<!-- io常用工具类 -->
...
...
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java
View file @
9fa3eac3
...
...
@@ -4,7 +4,7 @@ import java.util.Collection;
import
java.util.Set
;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.alibaba.fastjson
2
.annotation.JSONField
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
/**
...
...
ruoyi-common/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java
View file @
9fa3eac3
...
...
@@ -18,7 +18,7 @@ public class InvalidExtensionException extends FileUploadException
public
InvalidExtensionException
(
String
[]
allowedExtension
,
String
extension
,
String
filename
)
{
super
(
"文件["
+
filename
+
"]后缀["
+
extension
+
"]不正确,请上传
["
+
Arrays
.
toString
(
allowedExtension
)
+
"]格式文件
"
);
super
(
"文件["
+
filename
+
"]后缀["
+
extension
+
"]不正确,请上传
"
+
Arrays
.
toString
(
allowedExtension
)
+
"格式
"
);
this
.
allowedExtension
=
allowedExtension
;
this
.
extension
=
extension
;
this
.
filename
=
filename
;
...
...
ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java
View file @
9fa3eac3
...
...
@@ -2,7 +2,8 @@ package com.ruoyi.common.utils.ip;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson2.JSON
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.ruoyi.common.config.RuoYiConfig
;
import
com.ruoyi.common.constant.Constants
;
import
com.ruoyi.common.utils.StringUtils
;
...
...
@@ -40,7 +41,7 @@ public class AddressUtils
log
.
error
(
"获取地理位置异常 {}"
,
ip
);
return
UNKNOWN
;
}
JSONObject
obj
=
JSON
Object
.
parseObject
(
rspStr
);
JSONObject
obj
=
JSON
.
parseObject
(
rspStr
);
String
region
=
obj
.
getString
(
"pro"
);
String
city
=
obj
.
getString
(
"city"
);
return
String
.
format
(
"%s %s"
,
region
,
city
);
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java
View file @
9fa3eac3
...
...
@@ -14,7 +14,7 @@ import org.springframework.stereotype.Component;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.servlet.HandlerMapping
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson
2
.JSON
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.core.domain.model.LoginUser
;
import
com.ruoyi.common.enums.BusinessStatus
;
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/config/FastJson2JsonRedisSerializer.java
View file @
9fa3eac3
package
com.ruoyi.framework.config
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.fasterxml.jackson.databind.JavaType
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.type.TypeFactory
;
import
java.nio.charset.Charset
;
import
org.springframework.data.redis.serializer.RedisSerializer
;
import
org.springframework.data.redis.serializer.SerializationException
;
import
com.alibaba.fastjson.parser.ParserConfig
;
import
org.springframework.util.Assert
;
import
java.nio.charset.Charset
;
import
com.alibaba.fastjson2.JSON
;
import
com.alibaba.fastjson2.JSONReader
;
import
com.alibaba.fastjson2.JSONWriter
;
import
com.fasterxml.jackson.databind.JavaType
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.type.TypeFactory
;
/**
* Redis使用FastJson序列化
...
...
@@ -25,11 +25,6 @@ public class FastJson2JsonRedisSerializer<T> implements RedisSerializer<T>
private
Class
<
T
>
clazz
;
static
{
ParserConfig
.
getGlobalInstance
().
setAutoTypeSupport
(
true
);
}
public
FastJson2JsonRedisSerializer
(
Class
<
T
>
clazz
)
{
super
();
...
...
@@ -43,7 +38,7 @@ public class FastJson2JsonRedisSerializer<T> implements RedisSerializer<T>
{
return
new
byte
[
0
];
}
return
JSON
.
toJSONString
(
t
,
Serializer
Feature
.
WriteClassName
).
getBytes
(
DEFAULT_CHARSET
);
return
JSON
.
toJSONString
(
t
,
JSONWriter
.
Feature
.
WriteClassName
).
getBytes
(
DEFAULT_CHARSET
);
}
@Override
...
...
@@ -55,7 +50,7 @@ public class FastJson2JsonRedisSerializer<T> implements RedisSerializer<T>
}
String
str
=
new
String
(
bytes
,
DEFAULT_CHARSET
);
return
JSON
.
parseObject
(
str
,
clazz
);
return
JSON
.
parseObject
(
str
,
clazz
,
JSONReader
.
Feature
.
SupportAutoType
);
}
public
void
setObjectMapper
(
ObjectMapper
objectMapper
)
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java
View file @
9fa3eac3
...
...
@@ -6,7 +6,7 @@ import javax.servlet.http.HttpServletResponse;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.method.HandlerMethod
;
import
org.springframework.web.servlet.HandlerInterceptor
;
import
com.alibaba.fastjson
.JSONObject
;
import
com.alibaba.fastjson
2.JSON
;
import
com.ruoyi.common.annotation.RepeatSubmit
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.utils.ServletUtils
;
...
...
@@ -32,7 +32,7 @@ public abstract class RepeatSubmitInterceptor implements HandlerInterceptor
if
(
this
.
isRepeatSubmit
(
request
,
annotation
))
{
AjaxResult
ajaxResult
=
AjaxResult
.
error
(
annotation
.
message
());
ServletUtils
.
renderString
(
response
,
JSON
Object
.
toJSONString
(
ajaxResult
));
ServletUtils
.
renderString
(
response
,
JSON
.
toJSONString
(
ajaxResult
));
return
false
;
}
}
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java
View file @
9fa3eac3
...
...
@@ -7,7 +7,7 @@ import javax.servlet.http.HttpServletRequest;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
com.alibaba.fastjson
.JSONObject
;
import
com.alibaba.fastjson
2.JSON
;
import
com.ruoyi.common.annotation.RepeatSubmit
;
import
com.ruoyi.common.constant.Constants
;
import
com.ruoyi.common.core.redis.RedisCache
;
...
...
@@ -50,7 +50,7 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor
// body参数为空,获取Parameter的数据
if
(
StringUtils
.
isEmpty
(
nowParams
))
{
nowParams
=
JSON
Object
.
toJSONString
(
request
.
getParameterMap
());
nowParams
=
JSON
.
toJSONString
(
request
.
getParameterMap
());
}
Map
<
String
,
Object
>
nowDataMap
=
new
HashMap
<
String
,
Object
>();
nowDataMap
.
put
(
REPEAT_PARAMS
,
nowParams
);
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java
View file @
9fa3eac3
...
...
@@ -7,7 +7,7 @@ import javax.servlet.http.HttpServletResponse;
import
org.springframework.security.core.AuthenticationException
;
import
org.springframework.security.web.AuthenticationEntryPoint
;
import
org.springframework.stereotype.Component
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson
2
.JSON
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.utils.ServletUtils
;
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java
View file @
9fa3eac3
...
...
@@ -8,7 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.web.authentication.logout.LogoutSuccessHandler
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson
2
.JSON
;
import
com.ruoyi.common.constant.Constants
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.core.domain.AjaxResult
;
...
...
ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java
View file @
9fa3eac3
...
...
@@ -21,8 +21,8 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson
2
.JSON
;
import
com.alibaba.fastjson
2
.JSONObject
;
import
com.ruoyi.common.constant.Constants
;
import
com.ruoyi.common.constant.GenConstants
;
import
com.ruoyi.common.core.text.CharsetKit
;
...
...
@@ -401,7 +401,7 @@ public class GenTableServiceImpl implements IGenTableService
if
(
GenConstants
.
TPL_TREE
.
equals
(
genTable
.
getTplCategory
()))
{
String
options
=
JSON
.
toJSONString
(
genTable
.
getParams
());
JSONObject
paramsObj
=
JSON
Object
.
parseObject
(
options
);
JSONObject
paramsObj
=
JSON
.
parseObject
(
options
);
if
(
StringUtils
.
isEmpty
(
paramsObj
.
getString
(
GenConstants
.
TREE_CODE
)))
{
throw
new
ServiceException
(
"树编码字段不能为空"
);
...
...
@@ -485,7 +485,7 @@ public class GenTableServiceImpl implements IGenTableService
*/
public
void
setTableFromOptions
(
GenTable
genTable
)
{
JSONObject
paramsObj
=
JSON
Object
.
parseObject
(
genTable
.
getOptions
());
JSONObject
paramsObj
=
JSON
.
parseObject
(
genTable
.
getOptions
());
if
(
StringUtils
.
isNotNull
(
paramsObj
))
{
String
treeCode
=
paramsObj
.
getString
(
GenConstants
.
TREE_CODE
);
...
...
ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java
View file @
9fa3eac3
...
...
@@ -5,7 +5,8 @@ import java.util.HashSet;
import
java.util.List
;
import
java.util.Set
;
import
org.apache.velocity.VelocityContext
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson2.JSON
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.ruoyi.common.constant.GenConstants
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.StringUtils
;
...
...
@@ -75,7 +76,7 @@ public class VelocityUtils
public
static
void
setMenuVelocityContext
(
VelocityContext
context
,
GenTable
genTable
)
{
String
options
=
genTable
.
getOptions
();
JSONObject
paramsObj
=
JSON
Object
.
parseObject
(
options
);
JSONObject
paramsObj
=
JSON
.
parseObject
(
options
);
String
parentMenuId
=
getParentMenuId
(
paramsObj
);
context
.
put
(
"parentMenuId"
,
parentMenuId
);
}
...
...
@@ -83,7 +84,7 @@ public class VelocityUtils
public
static
void
setTreeVelocityContext
(
VelocityContext
context
,
GenTable
genTable
)
{
String
options
=
genTable
.
getOptions
();
JSONObject
paramsObj
=
JSON
Object
.
parseObject
(
options
);
JSONObject
paramsObj
=
JSON
.
parseObject
(
options
);
String
treeCode
=
getTreecode
(
paramsObj
);
String
treeParentCode
=
getTreeParentCode
(
paramsObj
);
String
treeName
=
getTreeName
(
paramsObj
);
...
...
@@ -381,7 +382,7 @@ public class VelocityUtils
public
static
int
getExpandColumn
(
GenTable
genTable
)
{
String
options
=
genTable
.
getOptions
();
JSONObject
paramsObj
=
JSON
Object
.
parseObject
(
options
);
JSONObject
paramsObj
=
JSON
.
parseObject
(
options
);
String
treeName
=
paramsObj
.
getString
(
GenConstants
.
TREE_NAME
);
int
num
=
0
;
for
(
GenTableColumn
column
:
genTable
.
getColumns
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment