Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jeecg-boot
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
jeecg-boot
Commits
7bdc1b06
Commit
7bdc1b06
authored
Feb 25, 2022
by
zhangdaiscott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决okhttp引用了kotlin,应用启动有警告日志问题
文件大小超限提示不准确问题
parent
e364b950
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/pom.xml
+6
-0
jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootExceptionHandler.java
+4
-2
No files found.
jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/pom.xml
View file @
7bdc1b06
...
@@ -239,6 +239,11 @@
...
@@ -239,6 +239,11 @@
<groupId>
com.squareup.okhttp3
</groupId>
<groupId>
com.squareup.okhttp3
</groupId>
<artifactId>
okhttp
</artifactId>
<artifactId>
okhttp
</artifactId>
</dependency>
</dependency>
<!-- 解决okhttp引用了kotlin,应用启动有警告日志问题 -->
<dependency>
<groupId>
com.fasterxml.jackson.module
</groupId>
<artifactId>
jackson-module-kotlin
</artifactId>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
\ No newline at end of file
jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootExceptionHandler.java
View file @
7bdc1b06
...
@@ -4,6 +4,7 @@ import io.lettuce.core.RedisConnectionException;
...
@@ -4,6 +4,7 @@ import io.lettuce.core.RedisConnectionException;
import
org.apache.shiro.authz.AuthorizationException
;
import
org.apache.shiro.authz.AuthorizationException
;
import
org.apache.shiro.authz.UnauthorizedException
;
import
org.apache.shiro.authz.UnauthorizedException
;
import
org.jeecg.common.api.vo.Result
;
import
org.jeecg.common.api.vo.Result
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.dao.DataIntegrityViolationException
;
import
org.springframework.dao.DataIntegrityViolationException
;
import
org.springframework.dao.DuplicateKeyException
;
import
org.springframework.dao.DuplicateKeyException
;
import
org.springframework.data.redis.connection.PoolException
;
import
org.springframework.data.redis.connection.PoolException
;
...
@@ -26,7 +27,8 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -26,7 +27,8 @@ import lombok.extern.slf4j.Slf4j;
@RestControllerAdvice
@RestControllerAdvice
@Slf4j
@Slf4j
public
class
JeecgBootExceptionHandler
{
public
class
JeecgBootExceptionHandler
{
@Value
(
"${spring.servlet.multipart.max-file-size}"
)
private
String
maxFileSize
;
/**
/**
* 处理自定义异常
* 处理自定义异常
*/
*/
...
@@ -100,7 +102,7 @@ public class JeecgBootExceptionHandler {
...
@@ -100,7 +102,7 @@ public class JeecgBootExceptionHandler {
@ExceptionHandler
(
MaxUploadSizeExceededException
.
class
)
@ExceptionHandler
(
MaxUploadSizeExceededException
.
class
)
public
Result
<?>
handleMaxUploadSizeExceededException
(
MaxUploadSizeExceededException
e
)
{
public
Result
<?>
handleMaxUploadSizeExceededException
(
MaxUploadSizeExceededException
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
return
Result
.
error
(
"文件大小超出10MB限制, 请压缩或降低文件质量! "
);
return
Result
.
error
(
String
.
format
(
"文件大小超出%s限制, 请压缩或降低文件质量! "
,
maxFileSize
)
);
}
}
@ExceptionHandler
(
DataIntegrityViolationException
.
class
)
@ExceptionHandler
(
DataIntegrityViolationException
.
class
)
...
...
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