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
ae5c6836
Commit
ae5c6836
authored
Oct 10, 2021
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
升级SpringBoot到最新版本2.5.5
parent
4fdb0f48
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
11 deletions
+16
-11
pom.xml
pom.xml
+1
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java
...om/ruoyi/web/controller/system/SysRegisterController.java
+1
-1
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java
...main/java/com/ruoyi/framework/config/ResourcesConfig.java
+10
-5
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java
.../ruoyi/framework/interceptor/RepeatSubmitInterceptor.java
+3
-3
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java
...a/com/ruoyi/framework/web/service/SysRegisterService.java
+1
-1
No files found.
pom.xml
View file @
ae5c6836
...
...
@@ -43,7 +43,7 @@
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-dependencies
</artifactId>
<version>
2.
2.13.RELEASE
</version>
<version>
2.
5.5
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java
View file @
ae5c6836
package
com.ruoyi.web.controller.system
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.model.RegisterBody
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.framework.web.service.SysRegisterService
;
import
com.ruoyi.system.service.ISysConfigService
;
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java
View file @
ae5c6836
...
...
@@ -28,10 +28,12 @@ public class ResourcesConfig implements WebMvcConfigurer
public
void
addResourceHandlers
(
ResourceHandlerRegistry
registry
)
{
/** 本地文件上传路径 */
registry
.
addResourceHandler
(
Constants
.
RESOURCE_PREFIX
+
"/**"
).
addResourceLocations
(
"file:"
+
RuoYiConfig
.
getProfile
()
+
"/"
);
registry
.
addResourceHandler
(
Constants
.
RESOURCE_PREFIX
+
"/**"
)
.
addResourceLocations
(
"file:"
+
RuoYiConfig
.
getProfile
()
+
"/"
);
/** swagger配置 */
registry
.
addResourceHandler
(
"/swagger-ui/**"
).
addResourceLocations
(
"classpath:/META-INF/resources/webjars/springfox-swagger-ui/"
);
registry
.
addResourceHandler
(
"/swagger-ui/**"
)
.
addResourceLocations
(
"classpath:/META-INF/resources/webjars/springfox-swagger-ui/"
);
}
/**
...
...
@@ -49,17 +51,20 @@ public class ResourcesConfig implements WebMvcConfigurer
@Bean
public
CorsFilter
corsFilter
()
{
UrlBasedCorsConfigurationSource
source
=
new
UrlBasedCorsConfigurationSource
();
CorsConfiguration
config
=
new
CorsConfiguration
();
config
.
setAllowCredentials
(
true
);
// 设置访问源地址
config
.
addAllowedOrigin
(
"*"
);
config
.
addAllowedOrigin
Pattern
(
"*"
);
// 设置访问源请求头
config
.
addAllowedHeader
(
"*"
);
// 设置访问源请求方法
config
.
addAllowedMethod
(
"*"
);
// 对接口配置跨域设置
// 有效期 1800秒
config
.
setMaxAge
(
1800L
);
// 添加映射路径,拦截一切请求
UrlBasedCorsConfigurationSource
source
=
new
UrlBasedCorsConfigurationSource
();
source
.
registerCorsConfiguration
(
"/**"
,
config
);
// 返回新的CorsFilter
return
new
CorsFilter
(
source
);
}
}
\ No newline at end of file
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java
View file @
ae5c6836
...
...
@@ -5,7 +5,7 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.method.HandlerMethod
;
import
org.springframework.web.servlet.
handler.HandlerInterceptorAdapte
r
;
import
org.springframework.web.servlet.
HandlerIntercepto
r
;
import
com.alibaba.fastjson.JSONObject
;
import
com.ruoyi.common.annotation.RepeatSubmit
;
import
com.ruoyi.common.core.domain.AjaxResult
;
...
...
@@ -17,7 +17,7 @@ import com.ruoyi.common.utils.ServletUtils;
* @author ruoyi
*/
@Component
public
abstract
class
RepeatSubmitInterceptor
extends
HandlerInterceptorAdapte
r
public
abstract
class
RepeatSubmitInterceptor
implements
HandlerIntercepto
r
{
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
...
...
@@ -40,7 +40,7 @@ public abstract class RepeatSubmitInterceptor extends HandlerInterceptorAdapter
}
else
{
return
super
.
preHandle
(
request
,
response
,
handler
)
;
return
true
;
}
}
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java
View file @
ae5c6836
...
...
@@ -2,7 +2,6 @@ package com.ruoyi.framework.web.service;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
com.ruoyi.common.constant.Constants
;
import
com.ruoyi.common.constant.UserConstants
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
...
...
@@ -12,6 +11,7 @@ import com.ruoyi.common.exception.user.CaptchaException;
import
com.ruoyi.common.exception.user.CaptchaExpireException
;
import
com.ruoyi.common.utils.MessageUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.framework.manager.AsyncManager
;
import
com.ruoyi.framework.manager.factory.AsyncFactory
;
import
com.ruoyi.system.service.ISysConfigService
;
...
...
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