Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cocktail-party-server
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
cocktail-party
cocktail-party-server
Commits
ae5c6836
提交
ae5c6836
authored
10月 10, 2021
作者:
RuoYi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
升级SpringBoot到最新版本2.5.5
上级
4fdb0f48
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
17 行增加
和
11 行删除
+17
-11
pom.xml
pom.xml
+1
-1
SysRegisterController.java
...om/ruoyi/web/controller/system/SysRegisterController.java
+1
-1
ResourcesConfig.java
...main/java/com/ruoyi/framework/config/ResourcesConfig.java
+11
-5
RepeatSubmitInterceptor.java
.../ruoyi/framework/interceptor/RepeatSubmitInterceptor.java
+3
-3
SysRegisterService.java
...a/com/ruoyi/framework/web/service/SysRegisterService.java
+1
-1
没有找到文件。
pom.xml
浏览文件 @
ae5c6836
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-dependencies
</artifactId>
<artifactId>
spring-boot-dependencies
</artifactId>
<version>
2.
2.13.RELEASE
</version>
<version>
2.
5.5
</version>
<type>
pom
</type>
<type>
pom
</type>
<scope>
import
</scope>
<scope>
import
</scope>
</dependency>
</dependency>
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java
浏览文件 @
ae5c6836
package
com
.
ruoyi
.
web
.
controller
.
system
;
package
com
.
ruoyi
.
web
.
controller
.
system
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.model.RegisterBody
;
import
com.ruoyi.common.core.domain.model.RegisterBody
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.framework.web.service.SysRegisterService
;
import
com.ruoyi.framework.web.service.SysRegisterService
;
import
com.ruoyi.system.service.ISysConfigService
;
import
com.ruoyi.system.service.ISysConfigService
;
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java
浏览文件 @
ae5c6836
...
@@ -28,10 +28,12 @@ public class ResourcesConfig implements WebMvcConfigurer
...
@@ -28,10 +28,12 @@ public class ResourcesConfig implements WebMvcConfigurer
public
void
addResourceHandlers
(
ResourceHandlerRegistry
registry
)
public
void
addResourceHandlers
(
ResourceHandlerRegistry
registry
)
{
{
/** 本地文件上传路径 */
/** 本地文件上传路径 */
registry
.
addResourceHandler
(
Constants
.
RESOURCE_PREFIX
+
"/**"
).
addResourceLocations
(
"file:"
+
RuoYiConfig
.
getProfile
()
+
"/"
);
registry
.
addResourceHandler
(
Constants
.
RESOURCE_PREFIX
+
"/**"
)
.
addResourceLocations
(
"file:"
+
RuoYiConfig
.
getProfile
()
+
"/"
);
/** swagger配置 */
/** 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
...
@@ -49,17 +51,20 @@ public class ResourcesConfig implements WebMvcConfigurer
@Bean
@Bean
public
CorsFilter
corsFilter
()
public
CorsFilter
corsFilter
()
{
{
UrlBasedCorsConfigurationSource
source
=
new
UrlBasedCorsConfigurationSource
();
CorsConfiguration
config
=
new
CorsConfiguration
();
CorsConfiguration
config
=
new
CorsConfiguration
();
config
.
setAllowCredentials
(
true
);
config
.
setAllowCredentials
(
true
);
// 设置访问源地址
// 设置访问源地址
config
.
addAllowedOrigin
(
"*"
);
config
.
addAllowedOrigin
Pattern
(
"*"
);
// 设置访问源请求头
// 设置访问源请求头
config
.
addAllowedHeader
(
"*"
);
config
.
addAllowedHeader
(
"*"
);
// 设置访问源请求方法
// 设置访问源请求方法
config
.
addAllowedMethod
(
"*"
);
config
.
addAllowedMethod
(
"*"
);
// 对接口配置跨域设置
// 有效期 1800秒
config
.
setMaxAge
(
1800L
);
// 添加映射路径,拦截一切请求
UrlBasedCorsConfigurationSource
source
=
new
UrlBasedCorsConfigurationSource
();
source
.
registerCorsConfiguration
(
"/**"
,
config
);
source
.
registerCorsConfiguration
(
"/**"
,
config
);
// 返回新的CorsFilter
return
new
CorsFilter
(
source
);
return
new
CorsFilter
(
source
);
}
}
}
}
\ No newline at end of file
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java
浏览文件 @
ae5c6836
...
@@ -5,7 +5,7 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -5,7 +5,7 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.method.HandlerMethod
;
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.alibaba.fastjson.JSONObject
;
import
com.ruoyi.common.annotation.RepeatSubmit
;
import
com.ruoyi.common.annotation.RepeatSubmit
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.AjaxResult
;
...
@@ -17,7 +17,7 @@ import com.ruoyi.common.utils.ServletUtils;
...
@@ -17,7 +17,7 @@ import com.ruoyi.common.utils.ServletUtils;
* @author ruoyi
* @author ruoyi
*/
*/
@Component
@Component
public
abstract
class
RepeatSubmitInterceptor
extends
HandlerInterceptorAdapte
r
public
abstract
class
RepeatSubmitInterceptor
implements
HandlerIntercepto
r
{
{
@Override
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
...
@@ -40,7 +40,7 @@ public abstract class RepeatSubmitInterceptor extends HandlerInterceptorAdapter
...
@@ -40,7 +40,7 @@ public abstract class RepeatSubmitInterceptor extends HandlerInterceptorAdapter
}
}
else
else
{
{
return
super
.
preHandle
(
request
,
response
,
handler
)
;
return
true
;
}
}
}
}
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java
浏览文件 @
ae5c6836
...
@@ -2,7 +2,6 @@ package com.ruoyi.framework.web.service;
...
@@ -2,7 +2,6 @@ package com.ruoyi.framework.web.service;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
com.ruoyi.common.constant.Constants
;
import
com.ruoyi.common.constant.Constants
;
import
com.ruoyi.common.constant.UserConstants
;
import
com.ruoyi.common.constant.UserConstants
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
...
@@ -12,6 +11,7 @@ import com.ruoyi.common.exception.user.CaptchaException;
...
@@ -12,6 +11,7 @@ import com.ruoyi.common.exception.user.CaptchaException;
import
com.ruoyi.common.exception.user.CaptchaExpireException
;
import
com.ruoyi.common.exception.user.CaptchaExpireException
;
import
com.ruoyi.common.utils.MessageUtils
;
import
com.ruoyi.common.utils.MessageUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.framework.manager.AsyncManager
;
import
com.ruoyi.framework.manager.AsyncManager
;
import
com.ruoyi.framework.manager.factory.AsyncFactory
;
import
com.ruoyi.framework.manager.factory.AsyncFactory
;
import
com.ruoyi.system.service.ISysConfigService
;
import
com.ruoyi.system.service.ISysConfigService
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论